home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / utility3 / vb_kbase.zip / VBKBASE1.TXT < prev    next >
Text File  |  1991-09-18  |  145KB  |  2,838 lines

  1.                     Microsoft Knowledge Base on Compuserve     9/18/91
  2.                       "Visual Basic" anywhere in document
  3.                           Part 1 thru June 25, 1991
  4.  
  5.  
  6. Title: How to Create a System-Modal Program/Window in Visual Basic 
  7. Document Number: Q72674           Publ Date:  6-JUN-1991 
  8. Product Name: Microsoft Visual Basic 
  9. Product Version:  1.00 
  10. Operating System: WINDOWS 
  11.  
  12.  Summary: 
  13.  From a Visual Basic program, you can disable the ability to switch to 
  14.  other Windows programs by calling the Windows 3.0 API function 
  15.  SetSysModalWindow. 
  16.  This information applies to Microsoft Visual Basic programming system 
  17.  version 1.0 for Windows. 
  18.  More Information: 
  19.  Microsoft Windows is designed so that the user can switch between 
  20.  applications without terminating one program to run another program. 
  21.  There may be times when the program needs to take control of the 
  22.  entire environment and run from only one window, restricting the user 
  23.  from switching to any other application. An example of this is a 
  24.  simple security system; or a time-critical application that may need 
  25.  to go uninterrupted for long periods of time. 
  26.  Passing the handle to the window through the argument of 
  27.  SetSysModalWindow will limit the user to that particular window. This 
  28.  will not allow the user to move to any other applications with the 
  29.  mouse or use ALT+ESC or CTRL+ESC to bring up the Task Manager. You 
  30.  could even remove the system menu if you do not want the user to exit 
  31.  through the ALT+F4 (Close) combination. 
  32.  All child windows that are created by the system-modal window become 
  33.  system-modal windows. When the original window becomes active again, 
  34.  it is system-modal. To end the system-modal state, destroy the 
  35.  original system-modal window. 
  36.  Care must be taking when using the SetSysModalWindow API from within 
  37.  the Visual Basic programmer's environment. Pressing CTRL+BREAK to get 
  38.  to the [break| mode leaves your modal form with no way to exit unless 
  39.  you restart your system. When using the SetSysModalWindow within the 
  40.  environment, be sure to exit your application by destroying the window 
  41.  with either the ALT+F4 in the system menu, or by some other means from 
  42.  within your running program. 
  43.  To use the SetSysModalWindow API function, declare the API call in 
  44.  your global section: 
  45.     Declare Function SetSysModalWindow Lib "User" (ByVal hwnd%) As Integer 
  46.  At an appropriate place in your code, add the following: 
  47.     Success% = SetSysModalWindow(hwnd) 
  48.  Once this line is executed, your window will be the only window that 
  49.  can get focus until that window is destroyed. 
  50.  Reference: 
  51.  1. "Programming Windows: the Microsoft Guide to Writing Applications 
  52.     for Windows 3," by Charles Petzold (published by Microsoft Press, 1990) 
  53.  2. "Microsoft Windows 3.0 Software Development Kit: Reference Volume 1" 
  54.  3. The WINSDK.HLP file shipped with Microsoft Windows 3.0 Software 
  55.     Development Kit. 
  56.  
  57. Knowledge Base
  58.  
  59. Title: VB "Out of Stack Space" with LoadPicture in Form_Paint Event 
  60. Document Number: Q72675           Publ Date:  6-JUN-1991 
  61. Product Name: Microsoft Visual Basic 
  62. Product Version:  1.00 
  63. Operating System: WINDOWS 
  64.  
  65.  Summary: 
  66.  An "Out of stack space" error can occur when you use a LoadPicture 
  67.  method within a Form_Paint event. 
  68.  This information applies to Microsoft Visual Basic programming system 
  69.  version 1.0 for Windows. 
  70.  More Information: 
  71.  The Visual Basic stack can be exhausted when the LoadPicture method is 
  72.  executed within a [control/form|_Paint event. The LoadPicture method 
  73.  generates a [control/form|_Paint event itself, and when performed 
  74.  within a _Paint event, the program will repeat the cycle until the 
  75.  stack is exhausted. 
  76.  The following code example demonstrates that the Form_Paint event is a 
  77.  recursive procedure when a LoadPicture method is included in the 
  78.  _Paint event code. 
  79.  After you add the code to your program, run the program and notice how 
  80.  many times the message "Form_Paint Count :" is displayed within the 
  81.  Immediate Window before you receive the "Out of stack space" error 
  82.  message. 
  83.  Sub Form_Paint () 
  84.        Static Count 
  85.        Count = Count + 1 
  86.        Debug.Print "Form_Paint Count : "; Count 
  87.        Form1.picture = LoadPicture("c:\windows\chess.bmp") 
  88.  End Sub 
  89.  To remedy the situation, move the LoadPicture to another event 
  90.  handler, such as the Form_Load event. Since these bitmaps are 
  91.  automatically refreshed when needed, you don't have to maintain the 
  92.  picture within a Paint event. 
  93.  The Visual Basic stack is limited to 16K bytes, and cannot be changed. 
  94.  
  95. Knowledge Base
  96.  
  97. Title: "Method Not Applicable For This Object" with SetFocus 
  98. Document Number: Q72676           Publ Date:  6-JUN-1991 
  99. Product Name: Microsoft Visual Basic 
  100. Product Version:  1.00 
  101. Operating System: WINDOWS 
  102.  
  103.  Summary: 
  104.  Visual Basic will return "Method Not Applicable For This Object" 
  105.  whenever you use the SetFocus method on a control that is on a form 
  106.  that is not visible. 
  107.  This information applies to Microsoft Visual Basic programming system 
  108.  version 1.0 for Windows. 
  109.  More Information: 
  110.  A control needs to be visible before you can execute the SetFocus 
  111.  method to that control. To make a control visible, the form must be 
  112.  loaded and the Visible property for the control must also be True 
  113.  {-1}. 
  114.  As an example, create two forms, and on each form, create a command 
  115.  button. 
  116.  In the code segment that follows, Form2 is not loaded yet, so you must 
  117.  show Form2 before you can set the focus to Form2.Command1. Once Form2 
  118.  has been loaded, you can set the focus to the visible control 
  119.  Form2.Command1. When you click the Form1.Command1 twice, you will 
  120.  receive the error "Method Not Applicable For This Object" because 
  121.  Form2.Command1's visible property was set to false during the previous 
  122.  call to Form_Click. 
  123.  '* This is the load event for Form1. 
  124.  Sub Form_Load () 
  125.     Form2.Show 
  126.     Form2.Command1.Visible = 0    'this is the default setting 
  127.  End Sub 
  128.  '* This is the click event for Form1.Command1 
  129.  Sub Command1_Click () 
  130.     Form2.Command1.SetFocus 
  131.     Form2.Command1.Visible = 0    'hide the control 
  132.  End Sub 
  133.  
  134. Knowledge Base
  135.  
  136. Title: How to Limit User Input In VB Combo/Text Box; SendMessage API 
  137. Document Number: Q72677           Publ Date:  6-JUN-1991 
  138. Product Name: Microsoft Visual Basic 
  139. Product Version:  1.00 
  140. Operating System: WINDOWS 
  141.  
  142.  Summary: 
  143.  You can specify a limit to the amount of text that can be entered into 
  144.  a text and/or combo box by calling SendMessage (a Windows 3.0 API 
  145.  function) with the EM_LIMITTEXT constant. 
  146.  This information applies to Microsoft Visual Basic programming system 
  147.  version 1.0 for Windows. 
  148.  More Information: 
  149.  The constant EM_LIMITTEXT can be sent to the SendMessage Windows 3.0 
  150.  API function to limit the length of a string entered into a combo 
  151.  and/or text box. 
  152.  Another method is to check the length of a string inside a KeyPress 
  153.  event for the control. If the length is over a specified amount, then 
  154.  the formal argument parameter KeyAscii will be set to zero. 
  155.  A cleaner way is to use the SendMessage API function call. After you 
  156.  set the Focus to the desired edit control, you must send a message to 
  157.  the window's message queue, which will reset the text limit for the 
  158.  control. The argument, EM_LIMITTEXT, as the second parameter to 
  159.  SendMessage will set the desired text limit based on the value 
  160.  specified by the third arguments. The SendMessage function requires 
  161.  the following parameters for setting the text limit: 
  162.     SendMessage (hWnd%,EM_LIMITTEXT, wParam%, lParam) 
  163.     wParam%   Specifies the maximum number of bytes that can be 
  164.               entered. If the user attempts to enter more 
  165.               characters, the edit control beeps and does not accept 
  166.               the characters. If the wParam parameter is zero, no 
  167.               limit is imposed on the size of the text(until no more 
  168.               memory is available) 
  169.     lParam    Is not used. 
  170.  As an example, do the following: 
  171.  1. Create a form called Form1. 
  172.  2. Add to Form1 a combo box called Combo1. 
  173.  3. Add the following code to the general declarations section of the 
  174.     form: 
  175.      '*** Note: Each Declare statement must be on just one line: 
  176.      Declare Function GetFocus% Lib "user" () 
  177.      Declare Function SendMessage& Lib "user" (ByVal hWnd%, 
  178.                                                ByVal wMsg%, 
  179.                                                ByVal wParam%, 
  180.                                                lp As Any) 
  181.      Declare Function PutFocus% Lib "user" Alias "SetFocus" 
  182.                                               (ByVal hWnd%) 
  183.      Const WM_USER = &H400 
  184.      Const EM_LIMITTEXT = WM_USER + 21 
  185.  4. Add the following code to the Form_Load event procedure: 
  186.      Sub Form_Load () 
  187.         Form1.Show            'Must show form to work on it 
  188.         Combo1.SetFocus       'Set the focus to the list box 
  189.         cbhWnd% = GetFocus()  'Get the handle to the list box 
  190.         TextLimit% = 5        'Specify the largest string 
  191.         retVal = SendMessage(cbhWnd%, EM_LIMITTEXT, TextLimit%, 0) 
  192.      End Sub 
  193.  5. Run the program and enter some text into the combo box. You will 
  194.     notice that you will only be able to enter a string of five 
  195.     characters into the combo box. 
  196.  Reference: 
  197.  1. "Programming Windows: the Microsoft Guide to Writing Applications 
  198.     for Windows 3," by Charles Petzold (published by Microsoft Press, 1990) 
  199.  2. "Microsoft Windows 3.0 Software Development Kit: Reference Volume 1" 
  200.  3. The WINSDK.HLP file shipped with Microsoft Windows 3.0 Software 
  201.     Development Kit. 
  202.  
  203. Knowledge Base
  204.  
  205. Title: VB Debug.Print in MouseMove Event Causes MouseMove Event 
  206. Document Number: Q72679           Publ Date:  6-JUN-1991 
  207. Product Name: Microsoft Visual Basic 
  208. Product Version:  1.00 
  209. Operating System: WINDOWS 
  210.  
  211.  Summary: 
  212.  Debug.Print used within the MouseMove event procedure of a form or 
  213.  control causes a MouseMove event. If the mouse cursor is located 
  214.  within the form or control, an endless stream of output to the 
  215.  Immediate Window will occur. This behavior occurs for a program run in 
  216.  the Visual Basic development environment. An .EXE program does not 
  217.  utilize the Immediate Window and the Debug object so this behavior 
  218.  does not apply to a .EXE program. The problem does not occur if a 
  219.  Print method is issued to any other form or control in the program. 
  220.  This is not a problem with Visual Basic, but rather the nature of the 
  221.  Microsoft Windows operating environment. 
  222.  This information applies to Microsoft Visual Basic programming system 
  223.  version 1.00 for Windows. 
  224.  More Information: 
  225.  If Debug.Print is used within the MouseMove event procedure of a form 
  226.  or control, an endless stream of output is sent to the Immediate 
  227.  Window. This occurs whenever the mouse cursor is within the form or 
  228.  control. This behavior occurs because the Debug.Print statement causes 
  229.  the focus to change briefly to the Immediate Window. When the focus 
  230.  returns to the form or control, Windows generates a MouseMove event 
  231.  that is processed by Visual Basic. There is no way for Visual Basic to 
  232.  suppress MouseMove events that are generated by Windows. The easiest 
  233.  way to overcome this behavior is to send debug output to another form 
  234.  or control. 
  235.  To duplicate this behavior, create a picture control (Picture1) within 
  236.  the default form (Form1). Add the following code segment to the 
  237.  MouseMove event procedure of Picture1: 
  238.       Sub Picture1_MouseMove (Button As Integer, Shift As Integer, 
  239.                               X As Single, Y As Single) 
  240.       ' You must write the above Sub statement on just one line. 
  241.           Static i% 
  242.           i% = i% + 1 
  243.           Debug.Print i% 
  244.       End Sub 
  245.  If you want output to be sent only when the mouse is moved, then all 
  246.  Debug.Print statements within the MouseMove event procedure should be 
  247.  changed to Print methods to other forms or controls. Below is a 
  248.  description of how to modify the example above such that output is 
  249.  produced only when the mouse is moved. 
  250.  Add another form (Form2) to the project by selecting New Form from the 
  251.  File menu (ALT F+F). Change the Debug.Print statement in the MouseMove 
  252.  event procedure for Picture1 to Form2.Print. Below is a copy of the 
  253.  above sample modified to send output to another form. 
  254.       Sub Picture1_MouseMove (Button As Integer, Shift As Integer, 
  255.                               X As Single, Y As Single) 
  256.       ' You must write the above Sub statement on just one line. 
  257.           Static i% 
  258.           i% = i% + 1 
  259.           Form2.Print i% 
  260.       End Sub 
  261.  In the example above, all output that scrolls off the form will be 
  262.  lost. A more sophisticated routine will be required to keep track of 
  263.  all output to the form. Such a routine is beyond the scope of this 
  264.  article. 
  265.  
  266. Knowledge Base
  267.  
  268. Title: Why Cooper Software Is Listed in Visual Basic's Copyright 
  269. Document Number: Q72747           Publ Date: 12-JUN-1991 
  270. Product Name: Microsoft Visual Basic 
  271. Product Version:  1.00 
  272. Operating System: WINDOWS 
  273.  
  274.  Summary: 
  275.  The Microsoft Visual Basic copyright notice acknowledges Cooper 
  276.  Software in both the sign-on dialog box and in the About dialog box 
  277.  from the Help menu. Visual Basic uses technology from a forms engine 
  278.  purchased from Cooper Software. The acknowledgment in Visual Basic is 
  279.  part of the contract between Microsoft and Cooper Software. 
  280.  This information applies to Microsoft Visual Basic programming system 
  281.  version 1.0 for Windows. 
  282.  
  283. Knowledge Base
  284.  
  285. Title: How to Trap a VB Form's Lost Focus with GetActiveWindow API 
  286. Document Number: Q69792           Publ Date: 20-MAY-1991 
  287. Product Name: Microsoft Visual Basic 
  288. Product Version:  1.00 
  289. Operating System: WINDOWS 
  290.  
  291.  Summary: 
  292.  The LostFocus event in Microsoft Visual Basic is useful when 
  293.  transferring control within an application. However, no global routine 
  294.  exists to check for the entire form losing the focus. One method to 
  295.  use to check whether your Visual Basic application has lost the focus 
  296.  is the Windows API call GetActiveWindow, as explained below. 
  297.  This information applies to Microsoft Visual Basic programming 
  298.  system version 1.00 for Windows. 
  299.  More Information: 
  300.  The only way for a Visual Basic application to check for loss of focus 
  301.  is to trigger the LostFocus event. A form does support a LostFocus 
  302.  event; however, a form will only get focus if there are no controls on 
  303.  that form. Focus goes to the controls on a form, and when you click 
  304.  any other visible form or window, the control's LostFocus procedure 
  305.  will be called. A control's LostFocus procedure will also be called 
  306.  when another control on the form is activated. To perform a routine 
  307.  that occurs only when the form loses focus requires careful management 
  308.  of what generated a LostFocus event on each control (such as setting a 
  309.  flag if another control's Click event was called). 
  310.  For a simpler method to check if a whole form has lost the focus, you 
  311.  can call the Windows API function GetActiveWindow, located in USER.DLL 
  312.  in Windows 3.00. The GetActiveWindow API call returns the window 
  313.  handle of the active window, which is the new window that you clicked. 
  314.  In every LostFocus procedure for every control on the old form, you 
  315.  would call GetActiveWindow and compare the return value with the old 
  316.  form's window handle (hWnd). The following program example 
  317.  demonstrates this technique: 
  318.  Program Example 
  319.  --------------- 
  320.  This single-form example will print "Lost Focus" on the form when you 
  321.  click a different window (such as when you click another program 
  322.  running in Windows). 
  323.  In Visual Basic, create one command button, Command1, on a single 
  324.  form, Form1. 
  325.  From VB.EXE's Code menu, choose View Code, and enter the following 
  326.  code for Form1 [using (general) from the Object box, and 
  327.  (declarations) from the Procedure box|: 
  328.     Declare Function GetActiveWindow Lib "User" () As Integer 
  329.  From the Object box, choose Command1, and from the Procedure box, 
  330.  choose LostFocus, and then put the following code in the 
  331.  Command1_LostFocus procedure: 
  332.  Sub Command1_LostFocus () 
  333.     If GetActiveWindow() <> Form1.hWND Then 
  334.        'Do form's lost-focus routines here. 
  335.        Print "Lost Focus" 
  336.     End If 
  337.  End Sub 
  338.  You can now run the program. 
  339.  Reference: 
  340.  
  341. Knowledge Base
  342.  
  343. Title: How to Create Scrollable Viewports in Visual Basic 
  344. Document Number: Q71068           Publ Date: 20-MAY-1991 
  345. Product Name: Microsoft Visual Basic 
  346. Product Version:  1.00 
  347. Operating System: WINDOWS 
  348.  
  349.  Summary: 
  350.  Scrollable viewports can be created within Visual Basic using standard 
  351.  Basic calls. The viewports can include bitmaps, graphics, or other 
  352.  controls. 
  353.  This information applies to Microsoft Visual Basic Programming System 
  354.  version 1.00 for Windows. 
  355.  More Information: 
  356.  To create a scrollable picture with clipping, you must have two 
  357.  picture controls. The first picture control is called the stationary 
  358.  parent picture control. Within the parent picture control, you need to 
  359.  create a movable child picture control. It is the child picture 
  360.  control that will be moved within the parent picture control. Moving 
  361.  the child picture within the parent picture control creates the 
  362.  clipping effect. During run time when you move the child picture, it 
  363.  will now be clipped by the boundaries of the parent picture. 
  364.  To create these two picture controls, do the following: 
  365.  1. Choose the picture box control from the Toolbox window in Visual 
  366.     Basic. 
  367.  2. Draw a picture on the form. This is the parent picture. 
  368.  3. Again choose the picture box control from the Toolbox window. 
  369.  4. Draw the second picture on top of and within the boundaries of 
  370.     the first picture control. This is the child picture. 
  371.  The sample application below shows how to create a scrollable bitmap 
  372.  within a viewport. Perform the sequence above to create a parent/child 
  373.  picture control. Add a horizontal scroll bar and a vertical scroll bar 
  374.  to the form. 
  375.  Make sure that the path to your bitmap is correct. Several of the 
  376.  properties are set during run time, which could have been set during 
  377.  design time as well. 
  378.  Moving the thumb of the two scroll bars will move the child picture 
  379.  within the parent picture. The handle (upper-left corner of the 
  380.  picture) to the child picture will be located either at (0,0) of the 
  381.  parent picture or to the left and/or right of the parent picture. 
  382.  Since the clipping region is that of the parent picture, the child 
  383.  picture will appear to move across the parent picture viewport. 
  384.  Sub Form_Load () 
  385.     Const PIXEL = 3 
  386.     Const TRUE = -1 
  387.     Const NONE = 0 
  388.     ' Set design properties, included here for simplicity. 
  389.     Form1.ScaleMode = PIXEL 
  390.     Picture1.ScaleMode = PIXEL 
  391.     Picture2.ScaleMode = PIXEL 
  392.     ' AutoSize is set to TRUE so that the boundaries of 
  393.     ' Picture2 are expanded to the size of the actual bitmap. 
  394.     Picture2.AutoSize = TRUE 
  395.     ' Get rid of annoying borders. 
  396.     Picture1.BorderStyle = NONE 
  397.     Picture2.BorderStyle = NONE 
  398.     ' Load the picture that you want to display. 
  399.     Picture2.Picture = LoadPicture("c:\win\party.bmp") 
  400.     ' Initialize location of both pictures. 
  401.     Picture1.Move 0, 0, ScaleWidth - VScroll1.Width,_ 
  402.                                     ScaleHeight - HScroll1.Height 
  403.     Picture2.Move 0, 0 
  404.     ' Position the horizontal scroll bar. 
  405.     HScroll1.Top = Picture1.Height 
  406.     HScroll1.Left = 0 
  407.     HScroll1.Width = Picture1.Width 
  408.     ' Position the vertical scroll bar. 
  409.     VScroll1.Top = 0 
  410.     VScroll1.Left = Picture1.Width 
  411.     VScroll1.Height = Picture1.Height 
  412.     ' Set the Max value for the scroll bars. 
  413.     HScroll1.Max = Picture2.Width - Picture1.Width 
  414.     VScroll1.Max = Picture2.Height - Picture1.Height 
  415.     ' Determine if child picture will fill up screen. 
  416.     ' If so, then there is no need to use scroll bars. 
  417.     VScroll1.Enabled = (Picture1.Height < Picture2.Height) 
  418.     HScroll1.Enabled = (Picture1.Width < Picture2.Width) 
  419.  End Sub 
  420.  Sub HScroll1_Change () 
  421.    ' Picture2.Left is set to the negative of the value because 
  422.    ' as you scroll the scroll bar to the right, the display 
  423.    ' should move to the Left, showing more of the right 
  424.    ' of the display, and vice-versa when scrolling to the 
  425.    ' left. 
  426.     Picture2.Left = -HScroll1.Value 
  427.  End Sub 
  428.  Sub VScroll1_Change () 
  429.    ' Picture2.Top is set to the negative of the value because 
  430.    ' as you scroll the scroll bar down, the display 
  431.    ' should move up, showing more of the bottom 
  432.    ' of the display, and vice-versa when scrolling up. 
  433.     Picture2.Top = -VScroll1.Value 
  434.  End Sub 
  435.  
  436. Knowledge Base
  437.  
  438. Title: How to Clear a VB List Box with a Windows API Function 
  439. Document Number: Q71069           Publ Date: 20-MAY-1991 
  440. Product Name: Microsoft Visual Basic 
  441. Product Version:  1.00 
  442. Operating System: WINDOWS 
  443.  
  444.  Summary: 
  445.  Customers commonly ask how to quickly clear the contents of a list box 
  446.  without clearing one item at a time. The following article shows how 
  447.  to instantly clear the contents of a list box by sending the list box 
  448.  a LB_RESETCONTENT message. 
  449.  This information applies to Microsoft Visual Basic Programming System 
  450.  version 1.00 for Windows. 
  451.  More Information: 
  452.  There is no single command within Visual Basic that will clear out the 
  453.  entries of a list box. However, by using the SendMessage function, you 
  454.  can clear out the list box with one command. The arguments to 
  455.  SendMessage with the LB_RESETCONTENT parameter are 
  456.     SendMessage(hWnd%, wMsg%, wParam%, lParam&) 
  457.  where: 
  458.     hWnd%    Identifies the window that is to receive the message. 
  459.     wMsg%    The message to be sent.  (&H405) 
  460.     wParam%  Is not used. (NULL) 
  461.     lParam&  Is not used. (NULL) 
  462.  Specifying wMsg% equal to &H405 removes all strings from the list box 
  463.  and frees any memory allocated for those strings. 
  464.  To get hWnd% you must call the Windows API function GetFocus. This 
  465.  method will return the handle to the control that currently has focus, 
  466.  in this case the list box that you want to delete all items from. 
  467.  The code listed below demonstrates how to delete entries from a list 
  468.  box: 
  469.  1. Create a list box called List1 on Form1. 
  470.  2. Declare the following Windows API functions at the module level or 
  471.     in the Global section of your code as follows: 
  472.  Declare Function SendMessage% Lib "user" (ByVal hWnd%,_ 
  473.                                            ByVal wMsg%,_ 
  474.                                            ByVal wParam%,_ 
  475.                                            ByVal lParam&) 
  476.  Declare Function GetFocus% Lib "user" () 
  477.  Declare Function PutFocus% Lib "user" Alias "SetFocus" (ByVal hWnd%) 
  478.     Note: Each Declare statement must be written on one line, leaving 
  479.     out the underscore (_) line-continuation symbol shown above. 
  480.  3. Declare the following constants in the same section: 
  481.  Const WM_USER = &H400 
  482.  Const LB_RESETCONTENT = WM_USER + 5 
  483.  4. Create a Sub within the (declarations) section of the code window 
  484.     with the following code: 
  485.  Sub ClearListBox (Ctrl As Control) 
  486.      hWndOld% = GetFocus() 
  487.      Ctrl.SetFocus 
  488.      x = SendMessage(GetFocus(), LB_RESETCONTENT, 0, 0) 
  489.      Suc% = PutFocus(hWndOld%) 
  490.  End Sub 
  491.  5. Now, within some event procedure, call ClearListBox with the name 
  492.     of the list box as a parameter: 
  493.  Sub Form_Click () 
  494.     ClearListBox List1 
  495.  End Sub 
  496.  6. Place some entries into the list box: 
  497.  Sub Form_Load () 
  498.      For i = 1 To 10 
  499.          List1.AddItem Format$(i)  'Put something into list box. 
  500.      Next 
  501.  End Sub 
  502.  6. Run the program and click anywhere on Form1. This will clear out 
  503.     the list box. 
  504.  
  505. Knowledge Base
  506.  
  507. Title: How to Emulate QuickBasic's SOUND Statement in Visual Basic 
  508. Document Number: Q71102           Publ Date: 20-MAY-1991 
  509. Product Name: Microsoft Visual Basic 
  510. Product Version:  1.00 
  511. Operating System: WINDOWS 
  512.  
  513.  Summary: 
  514.  The SOUND statement found in Microsoft QuickBASIC is not implemented 
  515.  within Microsoft Visual Basic. You can perform sound through a Windows 
  516.  3.00 API call that is equivalent to the QuickBASIC SOUND statement. 
  517.  This information applies to Microsoft Visual Basic Programming System 
  518.  version 1.00 for Windows. 
  519.  More Information: 
  520.  The QuickBASIC version of the SOUND statement can be executed by 
  521.  calling several Windows 3.00 API function calls. Within Windows, you 
  522.  must open up a VoiceQueue with the OpenSound call routine. Using the 
  523.  function SetVoiceSound, place all of the values corresponding to the 
  524.  desired frequencies and durations. Once the VoiceQueue has the desired 
  525.  frequencies and durations, you start the process by calling 
  526.  StartSound. After the sounds have been played, you must free up the 
  527.  VoiceQueue by calling CloseSound. If you plan on placing a large 
  528.  amount of information into the VoiceQueue, you may need to resize the 
  529.  VoiceQueue buffer by calling the SetVoiceQueueSize function. 
  530.  After executing the StartSound function, you cannot place any more 
  531.  sound into the VoiceQueue until the VoiceQueue is depleted. Placing 
  532.  more sound into the queue will overwrite any information that was 
  533.  previously in the VoiceQueue. If you are going to place sound into the 
  534.  VoiceQueue after a StartSound statement, you will need to call 
  535.  WaitSound with an argument of one. When WaitSound returns NULL, the 
  536.  VoiceQueue is empty and processing can continue. 
  537.  Below is an example of using the Windows API function calls, which will 
  538.  imitate the QuickBASIC SOUND statement: 
  539.  In the general section place the following: 
  540.  Declare Function OpenSound Lib "sound.drv" () As Integer 
  541.  Declare Function VoiceQueueSize Lib "sound.drv" 
  542.              (ByVal nVoice%, ByVal nBytes%) As Integer 
  543.  Declare Function SetVoiceSound Lib "sound.drv" 
  544.              (ByVal nSource%, ByVal Freq&, ByVal nDuration%) As Integer 
  545.  Declare Function StartSound Lib "sound.drv" () As Integer 
  546.  Declare Function CloseSound Lib "sound.drv" () As Integer 
  547.  Declare Function WaitSoundState Lib "sound.drv" (ByVal State%) As Integer 
  548.  Note: All Declare statements above each must be placed on one line. 
  549.  The SetVoiceSound takes two arguments. The first variable, Freq, is a 
  550.  two WORD parameter. The HIGH WORD will hold the actual frequency in 
  551.  hertz. The LOW WORD will hold the fractional frequency. The formula, X 
  552.  * 2 ^ 16, will shift the variable "X" into the HIGH WORD location. The 
  553.  second variable, Duration%, is the duration in clock ticks. There are 
  554.  18.2 tick clicks per second on all Intel computers. 
  555.  The following simplistic example shows how you can place several 
  556.  frequencies and durations into the VoiceQueue before starting the 
  557.  sound by calling the StartSound function: 
  558.  Sub Form_Click () 
  559.     Suc% = OpenSound() 
  560.     S% = SetVoiceSound(1, 100 * 2 ^ 16, 100)   ' Frequency = 100hz 
  561.     S% = SetVoiceSound(1, 90 * 2 ^ 16, 90)       ' Frequency = 90 hz 
  562.     S% = SetVoiceSound(1, 80 * 2 ^ 16, 90)       ' Frequency = 80 hz 
  563.     S% = StartSound() 
  564.     Succ% = CloseSound() 
  565.  End Sub 
  566.  The following is another simple example, which creates a siren sound: 
  567.  1. Within the general section, place the following Sound procedure: 
  568.  Sub Sound (ByVal Freq as Long, ByVal Duration%) 
  569.     Freq = Freq * 2 ^ 16                 ' Shift frequency to high byte. 
  570.     S% = SetVoiceSound(1, Freq, Duration%) 
  571.     S% = StartSound() 
  572.     While (WaitSoundState(1) <> 0): Wend 
  573.  End Sub 
  574.  2. Place the code below into any event procedure. The example below 
  575.     uses the Form_Click event procedure. Clicking any position on the 
  576.     form will create a police siren. 
  577.  Sub Form_Click () 
  578.     Suc% = OpenSound() 
  579.     For j& = 440 To 1000 Step 5 
  580.        Call Sound(j&, j& / 100) 
  581.     Next j& 
  582.     For j& = 1000 To 440 Step -5 
  583.        Call Sound(j&, j& / 100) 
  584.     Next j& 
  585.     Succ% = CloseSound() 
  586.  End Sub 
  587.  
  588. Knowledge Base
  589.  
  590. Title: How to Flood Fill in VB Using Windows API Function Call 
  591. Document Number: Q71103           Publ Date: 20-MAY-1991 
  592. Product Name: Microsoft Visual Basic 
  593. Product Version:  1.00 
  594. Operating System: WINDOWS 
  595.  
  596.  Summary: 
  597.  You can fill an area on a window in Visual Basic through a Windows API 
  598.  function call. Depending on the type of fill to be performed, you can 
  599.  use ExtFloodFill to achieve the desired effect. 
  600.  This information applies to Microsoft Visual Basic Programming System 
  601.  version 1.00 for Windows. 
  602.  More Information: 
  603.  The Windows API function call ExtFloodFill fills an area of the 
  604.  display surface with the current brush, as shown in the example below. 
  605.  Code Example 
  606.  ------------ 
  607.  From VB.EXE's Code menu, choose View Code, and enter the following 
  608.  code (on just one line) for Form1 [using (general) from the Object 
  609.  box, and (declarations) from the Procedure box|: 
  610.  Declare Function ExtFloodFill Lib "GDI" (ByVal hdc%, ByVal i%, 
  611.     ByVal i%, ByVal w&, ByVal i%) As Integer 
  612.  To demonstrate several fill examples, create a picture box called 
  613.  Picture1. Set the following properties: 
  614.  AutoSize = TRUE           ' Scale picture to size of imported picture. 
  615.  FillColor = &HFF00FF      ' This will be the selected fill color. 
  616.  FillStyle = Solid         ' Necessary to create a fill pattern. 
  617.  Picture = Chess.bmp       ' This should be in your Windows directory. 
  618.  Create a push button in a location that will not be overlapped by 
  619.  Picture1. Within the Click event, create the following code: 
  620.  Sub Command1_Click () 
  621.   ' Make sure that the FillStyle is not transparent. 
  622.   ' crColor& specifies the color for the boundary. 
  623.    Const FLOODFILLBORDER = 0  ' Fill until crColor& color encountered. 
  624.    Const FLOODFILLSURFACE = 1 ' Fill surface until crColor& color not 
  625.                               ' encountered. 
  626.    X% = 1 
  627.    Y% = 1 
  628.    crColor& = RGB(0, 0, 0) 
  629.    wFillType% = FLOODFILLSURFACE 
  630.    Suc% = ExtFloodFill(picture1.hDC, X%, Y%, crColor&, wFillType%) 
  631.  End Sub 
  632.  When you click on the push button, the black background will change to 
  633.  the FillColor. The fill area is defined by the color specified by 
  634.  crColor&. Filling continues outward from (X%,Y%) as long as the color 
  635.  is encountered. 
  636.  Now change the related code to represent the following: 
  637.     crColor& = RGB(255, 0, 0)  'Color to look for. 
  638.     wFillType% = FLOODFILLBORDER 
  639.     Suc% =  ExtFloodFill(picture1.hDC, X%, Y%, crColor&, wFillType%) 
  640.  Executing the push button will now fill the area until crColor& is 
  641.  encountered. In the first example, the fill was performed while the 
  642.  color was encountered; in the second example, the fill was performed 
  643.  while the color was NOT encountered. In the last example, everything 
  644.  is changed except the "floating pawn". 
  645.  
  646. Knowledge Base
  647.  
  648. Title: How to Use Windows 3.0 BitBlt Function from Visual Basic 
  649. Document Number: Q71104           Publ Date: 10-JUN-1991 
  650. Product Name: Microsoft Visual Basic 
  651. Product Version:  1.00 
  652. Operating System: WINDOWS 
  653.  
  654.  Summary: 
  655.  The Windows GDI.DLL has a function call BitBlt, which will move the 
  656.  source device given by the hSrcDC parameter to the destination device 
  657.  given by the hDestDC parameter. This article explains in detail the 
  658.  arguments of the Windows BitBlt function call. 
  659.  This information applies to Microsoft Visual Basic Programming System 
  660.  version 1.00 for Windows. 
  661.  More Information: 
  662.  To use BitBlt within a Visual Basic application, you must Declare 
  663.  the BitBlt function in either the Global section or within the 
  664.  (declaration) section of your code window. Declare the Function as 
  665.  follows: 
  666.  Declare Function BitBlt Lib "gdi" (ByVal hDestDC%, 
  667.                                     ByVal X%, ByVal Y%, 
  668.                                     ByVal nWidth%, 
  669.                                     ByVal nHeight%, 
  670.                                     ByVal hSrcDC%, 
  671.                                     ByVal XSrc%, ByVal YSrc%, 
  672.                                     ByVal dwRop&) As Integer 
  673.  Note: The above Declare statement must be written on just one line. 
  674.  The following formal parameters are defined as: 
  675.     Formal Parameter   Definition 
  676.     ----------------   ---------- 
  677.     hDestDC            Specifies the device context that is to 
  678.                        receive the bitmap. 
  679.     X,Y                Specifies the logical x-coordinate and 
  680.                        y-coordinate of the upper-left corner of the 
  681.                        destination rectangle. 
  682.     nWidth, nHeight    Specifies the width (in logical units) of the 
  683.                        destination rectangle and the source bitmap. 
  684.     nHeight            Specifies the height (in logical units) of 
  685.                        the destination rectangle and the source 
  686.                        bitmap. 
  687.     hSrcDC             Identifies the device context from which the 
  688.                        bitmap will be copied. It must be 
  689.                        NULL(zero) if the dwRop& parameter specifies 
  690.                        a raster operation that does not include a 
  691.                        source. 
  692.     XSrc               Specifies the logical x-coordinate and the 
  693.                        y-coordinate of the upper-left corner of the 
  694.                        source bitmap. 
  695.    dwRop               Specifies the raster operation to be performed 
  696.                        as defined below. 
  697.  The following Raster operations are defined using the predefined 
  698.  constants found in the WINDOWS.H file supplied with the Microsoft 
  699.  Windows version 3.00 Software Development Kit (SDK). The value within 
  700.  the "()" is the value to assign to the dwRop& variable. 
  701.     Code/Value (hex)    Description 
  702.     ----------------    ----------- 
  703.     BLACKNESS (42)      Turn output black. 
  704.     DSINVERT(550009)    Inverts the destination bitmap. 
  705.     MERGECOPY(C000CA)   Combines the pattern and the source bitmap 
  706.                         using the Boolean AND operation. 
  707.     MERGEPAINT(BB0226)  Combines the inverted source bitmap with the 
  708.                         destination bitmap using the Boolean OR 
  709.                         operator. 
  710.     NOTSRCCOPY(330008)  Copies the inverted source bitmap to the 
  711.                         destination. 
  712.     NOTSRCERASE(1100A6) Inverts the result of combining the 
  713.                         destination and source bitmap using the 
  714.                         Boolean OR operator. 
  715.     PATCOPY(F00021)     Copies the pattern to the destination bitmap. 
  716.     PATINVERT(5A0049)   Combines the destination bitmap with the 
  717.                         pattern using the Boolean XOR operator. 
  718.     PATPAINT(FB0A09)    Combines the inverted source bitmap with the 
  719.                         pattern using the Boolean OR operator. 
  720.                         Combines the result of this operation with 
  721.                         the destination bitmap using the Boolean OR 
  722.                         operator. 
  723.     SRCAND(8800C6)      Combines pixels of the destination and source 
  724.                         bitmap using the Boolean AND operator. 
  725.     SRCCOPY(CC0020)     Copies the source bitmap to the destination 
  726.                         bitmap. 
  727.     SRCERASE(4400328)   Inverts the destination bitmap and combines 
  728.                         the results with the source bitmap using the 
  729.                         Boolean AND operator. 
  730.     SRCINVERT(660046)   Combines pixels of the destination and source 
  731.                         bitmap using the Boolean XOR operator. 
  732.     SRCPAINT(EE0086)    Combines pixels of the destination and source 
  733.                         bitmap using the Boolean OR operator. 
  734.     WHITENESS(FF0062)   Turns all output white. 
  735.  Below is an example of how to copy the contents of a picture control 
  736.  to the contents of another picture control. 
  737.  Define a form with two picture controls. Display some graphics on 
  738.  Picture1 by loading from a picture file or pasting from the clipboard 
  739.  at design time. You can load a picture from a file as follows: from 
  740.  the Properties bar, select Picture from the Properties list box and 
  741.  click the arrow at the right of the Settings box, then select the 
  742.  desired picture file (such as a .BMP or .ICO file supplied with 
  743.  Microsoft Windows) from the dialog box. 
  744.  Add the following code to the Form_Click procedure. Run the program 
  745.  and click the form. The contents of the first picture will be 
  746.  displayed to the second picture. 
  747.  Sub Form_Click () 
  748.     ' Assign information of the destination bitmap. Note that Bitblt 
  749.     ' requires coordinates in pixels. 
  750.     Const PIXEL = 3 
  751.     Picture1.ScaleMode = PIXEL 
  752.     Picture2.ScaleMode = PIXEL 
  753.     hDestDC% = Picture2.hDC 
  754.     X% = 0: Y% = 0 
  755.     nWidth% = Picture2.ScaleWidth 
  756.     nHeight% = Picture2.ScaleHeight 
  757.     ' Assign information of the source bitmap. 
  758.     hSrcDC% = Picture1.hDC 
  759.     XSrc% = 0: YSrc% = 0 
  760.     ' Assign the SRCCOPY constant to the Raster operation. 
  761.     dwRop& = &HCC0020 
  762.     Suc% = BitBlt(hDestDC%, X%, Y%, nWidth%, nHeight%,_ 
  763.                            hSrcDC%, XSrc%, YSrc%, dwRop&) 
  764.  End Sub 
  765.  
  766. Knowledge Base
  767.  
  768. Title: How to Set Hourglass MousePointer in VB Program During Delays 
  769. Document Number: Q71105           Publ Date: 20-MAY-1991 
  770. Product Name: Microsoft Visual Basic 
  771. Product Version:  1.00 
  772. Operating System: MS-DOS 
  773.  
  774.  Summary: 
  775.  During operations that take time, you may decide to display the 
  776.  hourglass mouse cursor. This will let the user know that the computer 
  777.  is performing an operation that may take some noticeable time, and 
  778.  that no user input will be immediately processed during this time. 
  779.  This information applies to Microsoft Visual Basic Programming System 
  780.  version 1.00 for Windows. 
  781.  More Information: 
  782.  The MousePointer property can be set during design time or during run 
  783.  time. During operations that may take some noticeable amount of time, 
  784.  the MousePointer should be set to the hourglass pointer. This can be 
  785.  performed using the Screen.MousePointer property. Before setting the 
  786.  mouse pointer to the hourglass, you should save the present mouse 
  787.  pointer so that when you are through with the hourglass cursor, you 
  788.  can re-initialize it to the previous pointer. Below is an example of 
  789.  setting the pointer to the hourglass cursor: 
  790.  Sub Form_Click () 
  791.     SavedPointer = Screen.MousePointer  ' Save mouse pointer. 
  792.     Screen.MousePointer = 11            ' 11# = hourglass. 
  793.     For i = 1 To 10000: Next i          ' Some lengthy operation. 
  794.     Screen.MousePointer = SavedPointer  ' set to previous mouse pointer. 
  795.  End Sub 
  796.  
  797. Knowledge Base
  798.  
  799. Title: How to Pass One-Byte Parameters from VB to DLL Routines 
  800. Document Number: Q71106           Publ Date: 20-MAY-1991 
  801. Product Name: Microsoft Visual Basic 
  802. Product Version:  1.00 
  803. Operating System: WINDOWS 
  804.  
  805.  Summary: 
  806.  Calling some routines in dynamic link libraries (DLLs) requires BYTE 
  807.  parameters in the argument list. Visual Basic possesses no BYTE data 
  808.  type as defined in other languages such as C, which can create DLLs. 
  809.  To pass a BYTE value correctly to an external FUNCTION (in a DLL), 
  810.  which requires a BYTE data type, you must pass an integer data type 
  811.  for the BYTE parameter. 
  812.  This information applies to Microsoft Visual Basic Programming System 
  813.  version 1.00 for Windows. 
  814.  More Information: 
  815.  Visual BASIC has the ability to call external code in the form of 
  816.  dynamic link libraries (DLLs). Some of these libraries require BYTE 
  817.  parameters in the argument list. An example of this is located in the 
  818.  KEYBOARD.DRV FUNCTION as defined below: 
  819.      FUNCTION GetTempFileName (BYTE  cDrive, 
  820.                                LPSTR lpPrefix, 
  821.                                WORD  wUnique, 
  822.                                LPSTR lpTempFileName) 
  823.  GetTempFileName is documented on page 4-217 of the "Microsoft Windows 
  824.  3.0 Software Development Kit, Reference - Volume 1." In Visual BASIC, 
  825.  declare the FUNCTION on one line in the main module of your code: 
  826.     DECLARE FUNCTION GetTempFileName LIB "keyboard.drv" 
  827.                     (BYVAL A%,  BYVAL B$, BYVAL C%, BYVAL D$) 
  828.  Because the architecture of the 80x86 stack is segmented into word 
  829.  boundaries, the smallest type pushed onto the stack will be a word. 
  830.  Therefore, both the BYTE and the integer will be pushed onto the stack 
  831.  in the same manner, and require the same amount of memory. This is the 
  832.  reason you can use an integer data type for a BYTE data type in these 
  833.  types of procedure calls. 
  834.  
  835. Knowledge Base
  836.  
  837. Title: How to Send an HBITMAP to Windows API Function Calls from VB 
  838. Document Number: Q71260           Publ Date: 20-MAY-1991 
  839. Product Name: Microsoft Visual Basic 
  840. Product Version:  1.00 
  841. Operating System: WINDOWS 
  842.  
  843.  Summary: 
  844.  Several Windows API functions require the HBITMAP data type. Visual 
  845.  Basic does not have a HBITMAP data type. This article explains how to 
  846.  send the equivalent Visual Basic HBITMAP handle of a picture control 
  847.  to a Windows API function call. 
  848.  This information applies to Microsoft Visual Basic Programming System 
  849.  version 1.00 for Windows. 
  850.  More Information: 
  851.  The HBITMAP data type represents a 16-bit index to GDIs physical 
  852.  drawing object. Several Windows API routines need the HBITMAP data 
  853.  type as an argument. Sending the [picture-control|.Picture as an 
  854.  argument is the equivalent in Visual Basic. 
  855.  The code sample below demonstrates how to send HBITMAP to the Windows 
  856.  API function ModifyMenu. 
  857.  Declare Function SetMenuItemBitMaps% Lib "user" (ByVal hMenu%, 
  858.                                              ByVal  nPos%, 
  859.                                              ByVal wFlag%, 
  860.                                              ByVal BitmapUnChecked%, 
  861.                                              ByVal hBitmapChecked%) 
  862.  Note: The above Declare statement must be written on just one line. 
  863.  The SetMenuItemBitMap takes five arguments. The fourth and fifth 
  864.  arguments are HBITMAP data types. 
  865.  The following code segment will associate the specified bitmap 
  866.  Picture1.Picture in place of the default check mark: 
  867.  X% = SetMenuItemBitMap(hMenu%, menuID%,0,0, Picture1.Picture) 
  868.  Reference: 
  869.  1. "Programming Windows: the Microsoft Guide to Writing Applications 
  870.     for Windows 3," by Charles Petzold (published by Microsoft 
  871.     Press, 1990) 
  872.  2. "Microsoft Windows 3.0 Software Development Kit: Reference 
  873.     Volume 1" 
  874.  3. The WINSDK.HLP file shipped with Microsoft Windows 3.0 Software 
  875.     Development Kit. 
  876.  
  877. Knowledge Base
  878.  
  879. Title: How to Create Pop-up Menus on a Visual Basic Form 
  880. Document Number: Q71279           Publ Date: 20-MAY-1991 
  881. Product Name: Microsoft Visual Basic 
  882. Product Version:  1.00 
  883. Operating System: WINDOWS 
  884.  
  885.  Summary: 
  886.  Visual Basic can call the Windows API function TrackPopupMenu to 
  887.  display a specified menu at the location on the screen that the user 
  888.  clicks with the mouse. 
  889.  This information applies to Microsoft Visual Basic Programming 
  890.  System version 1.00 for Windows. 
  891.  More Information: 
  892.  The TrackPopupMenu function displays a "floating" pop-up menu at the 
  893.  specified location and tracks the selection of items on the pop-up 
  894.  menu. A floating pop-up menu can appear anywhere on the screen. The 
  895.  hMenu parameter specifies the handle of the menu to be displayed; the 
  896.  application obtains this handle by calling GetSubMenu to retrieve the 
  897.  handle of a pop-up menu associated with an existing menu item. 
  898.  TrackPopupMenu is defined as follows 
  899.     TrackPopupMenu (hMenu%,wFlags%, X%, Y%, rRes%, hwnd%, lpRes&) 
  900.  where: 
  901.     hMenu%  - Identifies the pop-up menu to be displayed. 
  902.     wFlags% - Not used. This parameter must be set to zero. 
  903.     x%      - Specifies the horizontal position in screen coordinates 
  904.               of the left side of the menu on the screen. 
  905.     y%      - Specifies the vertical position in screen coordinates 
  906.               of the top of the menu on the screen. 
  907.     nRes%   - Is reserved and must be set to zero. 
  908.     hWnd%   - Identifies the window that owns the pop-up menu. 
  909.     lpRes&  - Is reserved and must be set to NULL. 
  910.  The supporting Windows API functions needed to support the arguments 
  911.  to TrackPopupMenu are: 
  912.  1. GetMenu(hWnd%) 
  913.     hWnd%   - Identifies the window whose menu is to be examined. 
  914.     GetMenu returns a value that identifies the menu. The return value 
  915.     is NULL if the given window has no menu. The return value is 
  916.     undefined if the window is a child window. 
  917.  2. GetSubMenu(hMenu%, nPos%) 
  918.     hMenu%  - Identifies the menu. 
  919.     nPos%   - Specifies the position in the given menu of the pop-up 
  920.               menu. Position values start at zero for the first 
  921.               menu item. 
  922.     GetSubMenu returns a value that identifies the given pop-up menu. 
  923.     The return value is NULL if no pop-up menu exists at the given 
  924.     position. 
  925.  To create a pop-up menu within Visual Basic, define a menu system with 
  926.  the Menu Design window. The following is an example of a menu system: 
  927.     Caption    CntlName    Indented 
  928.     -------    --------    -------- 
  929.     File       M_File      No 
  930.     New        M_New       Once 
  931.     Open       M_Open      Once 
  932.     Close      M_Close     Once 
  933.     Exit       M_Exit      Once 
  934.     Help       M_Help      No 
  935.  Within the general-declaration section of your Code window, declare 
  936.  the following: 
  937.  Declare Function TrackPopupMenu% Lib "user"(ByVal hMenu%, 
  938.                                              ByVal wFlags%, 
  939.                                              ByVal X%, ByVal Y%, 
  940.                                              ByVal r2%, ByVal hwnd%, 
  941.                                              ByVal r1&) 
  942.  Declare Function GetMenu% Lib "user" (ByVal hwnd%) 
  943.  Declare Function GetSubMenu% Lib "user" (ByVal hMenu%, ByVal nPos%) 
  944.  Note: Each Declare statement above must be located on just one line. 
  945.  Place the following code in the form's MouseUp event procedure: 
  946.  Sub Form1_MouseUp (Button As Integer, Shift As Integer, X As Single, 
  947.                                                   Y As Single) 
  948.     ' The above Sub statement must be concatenated onto one line. 
  949.     Const PIXEL = 3 
  950.     Const TWIP = 1 
  951.      ScaleMode = PIXEL 
  952.      InPixels = ScaleWidth 
  953.      ScaleMode = TWIP 
  954.      IX = (X + Left) \ (ScaleWidth \ InPixels) 
  955.      IY = (Y + (Top + (Height - ScaleHeight - 
  956.                    (Width - ScaleWidth)))) \ (ScaleWidth \ InPixels) 
  957.      ' The above IY = ... statement must be concatenated onto one line. 
  958.      hMenu% = GetMenu(hwnd) 
  959.      hSubMenu% = GetSubMenu(hMenu%, Button - 1) 
  960.      R = TrackPopupMenu(hSubMenu%, 0, IX, IY, 0, hwnd, 0) 
  961.  End Sub 
  962.  When you run the program, clicking anywhere on Form1 will display the 
  963.  first menu on your menu bar at that location. 
  964.  Reference: 
  965.  1. "Programming Windows: the Microsoft Guide to Writing Applications 
  966.     for Windows 3," by Charles Petzold (published by Microsoft 
  967.     Press, 1990) 
  968.  2. "Microsoft Windows 3.0 Software Development Kit: Reference 
  969.     Volume 1" 
  970.  3. The WINSDK.HLP file shipped with Microsoft Windows 3.0 Software 
  971.     Development Kit. 
  972.  
  973. Knowledge Base
  974.  
  975. Title: How to Create a Flashing Title Bar on a Visual Basic Form 
  976. Document Number: Q71280           Publ Date: 20-MAY-1991 
  977. Product Name: Microsoft Visual Basic 
  978. Product Version:  1.00 
  979. Operating System: WINDOWS 
  980.  
  981.  Summary: 
  982.  When calling a Windows API function call, you can create a flashing 
  983.  window title bar on the present form or any other form for which you 
  984.  know the handle. 
  985.  This information applies to Microsoft Visual Basic Programming System 
  986.  version 1.00 for Windows. 
  987.  More Information: 
  988.  Visual Basic has the ability to flash the title bar on any other form 
  989.  if you can get the handle to that form. The function FlashWindow 
  990.  flashes the specified window once. Flashing a window means changing 
  991.  the appearance of its caption bar, as if the window were changing from 
  992.  inactive to active status, or vice versa. (An inactive caption bar 
  993.  changes to an active caption bar; an active caption bar changes to an 
  994.  inactive caption bar.) 
  995.  Typically, a window is flashed to inform the user that the window 
  996.  requires attention when that window does not currently have the input 
  997.  focus. 
  998.  The function FlashWindow is defined as 
  999.     FlashWindow(hWnd%, bInvert%) 
  1000.  where: 
  1001.     hWnd%     - Identifies the window to be flashed. The window can be 
  1002.                 either open or iconic. 
  1003.     bInvert%  - Specifies whether the window is to be flashed or 
  1004.                 returned to its original state. The window is flashed 
  1005.                 from one state to the other if the bInvert parameter is 
  1006.                 nonzero. If the bInvert parameter is zero, the window 
  1007.                 is returned to its original state (either active or 
  1008.                 inactive). 
  1009.  FlashWindow returns a value that specifies the window's state before 
  1010.  the call to the FlashWindow function. It is nonzero if the window was 
  1011.  active before the call; otherwise, it is zero. 
  1012.  The following section describes how to flash a form while that form 
  1013.  does not have the focus: 
  1014.  1. Create two forms called Form1 and Form2. 
  1015.  2. On Form1, create a timer control and set the Interval Property to 
  1016.     1000. Also set the Enabled Property to FALSE. 
  1017.  3. Within the general-declarations section of Form1, declare the 
  1018.     FlashWindow function as follows: 
  1019.        Declare Function FlashWindow% Lib "user" (ByVal hWnd%, 
  1020.                                                  ByVal bInvert%) 
  1021.  4.  Define the following constants directly after the declarations 
  1022.      section: 
  1023.         Const TRUE = -1 
  1024.         Const FALSE = 0 
  1025.  5. In the Form_Load event procedure, add the following code: 
  1026.        Sub Form_Load () 
  1027.           Form2.Show 
  1028.        End Sub 
  1029.  6. In the Sub_Time1_Timer () procedure of Form1, add the following 
  1030.     code: 
  1031.        Sub Timer1_Timer () 
  1032.           Succ% = FlashWindow(Form1.hWnd, 1) 
  1033.        End Sub 
  1034.  7. In the GetFocus event procedure of Form1, create the following 
  1035.     code: 
  1036.        Sub Form_GotFocus () 
  1037.          Timer1.Enabled = 0 
  1038.        End Sub 
  1039.  8. In the Click event for Form2, add the following code: 
  1040.        Sub Form_Click () 
  1041.           Form1.Timer1.Enabled = -1 
  1042.        End Sub 
  1043.  9. Run the program. Form1 will be in the foreground with Form2 in the 
  1044.     background. Click anywhere on Form2; Form1's Caption Bar will flash 
  1045.     until you click on Form1. 
  1046.  Reference: 
  1047.  1. "Programming Windows: the Microsoft Guide to Writing Applications 
  1048.     for Windows 3," by Charles Petzold (published by Microsoft 
  1049.     Press, 1990) 
  1050.  2. "Microsoft Windows 3.0 Software Development Kit: Reference 
  1051.     Volume 1" 
  1052.  3. The WINSDK.HLP file shipped with Microsoft Windows 3.0 Software 
  1053.     Development Kit. 
  1054.  
  1055. Knowledge Base
  1056.  
  1057. Title: How to Implement Bitmaps Within Visual Basic Menus 
  1058. Document Number: Q71281           Publ Date: 20-MAY-1991 
  1059. Product Name: Microsoft Visual Basic 
  1060. Product Version:  1.00 
  1061. Operating System: WINDOWS 
  1062.  
  1063.  Summary: 
  1064.  There is no command within Visual Basic that will add bitmaps to the 
  1065.  menu system. There are several Windows API functions that you can call 
  1066.  that will place bitmaps within the menu system. You may also change 
  1067.  the default check mark displayed. 
  1068.  This information applies to Microsoft Visual Basic Programming System 
  1069.  version 1.00 for Windows. 
  1070.  More Information: 
  1071.  There are several Windows API functions that you can call that will 
  1072.  display bitmaps instead of text in the menu system. 
  1073.  Below is a list of the required Windows API functions: 
  1074.  1. GetMenu% (hwnd%) 
  1075.     hwnd%   -  Identifies the window whose menu is to be examined. 
  1076.     Returns:   Handle to the menu. 
  1077.  2. GetSubMenu% (hMenu%, nPos%) 
  1078.     hMenu%  - Identifies the menu. 
  1079.     nPos%   - Specifies the position (zero-based) in the given menu of 
  1080.               the pop-up menu. 
  1081.     Returns:  Handle to the given pop-up menu. 
  1082.  3. GetMenuItemID% (hMenu%, nPos%) 
  1083.     hMenu%  - Identifies the handle to the pop-up menu that contains 
  1084.               the item whose ID is being retrieved. 
  1085.     nPos    - Specifies the position(zero-based) of the menu whose ID 
  1086.               is being retrieved. 
  1087.     Returns:  The item ID for the specified item in the pop-up menu. 
  1088.  4. ModifyMenu% (hMenu%, nPos%, wFlags%, wIDNewItem%, lpNewItem&) 
  1089.     hMenu%  - Identifies the handle to the pop-up menu that contains 
  1090.               the item whose ID is being retrieved. 
  1091.     nPos%   - Specifies the menu item to be changed.  The 
  1092.               interpretation of the nPos parameter depends on the 
  1093.               wFlags parameter. 
  1094.     wFlags% - BF_BITMAP  =  &H4 
  1095.     wIDNewItem% - Specifies the command ID of the modified menu item. 
  1096.     lpNewItem&  - 32-bit handle to the bitmap. 
  1097.     Returns:  TRUE if successful, FALSE if unsuccessful. 
  1098.  5. SetMenuItemBitmaps% (hMenu%, nPos%, wFlags%,hBitmapUnchecked%, 
  1099.                         hBitmapChecked%) 
  1100.     hMenu%  - Identifies menu to be changed. 
  1101.     nPos%   - Command ID of the menu item 
  1102.     wFlags% - &H0 
  1103.     hBitmapUnchecked% - Handle to "unchecked" bitmap. 
  1104.     hBitmapChecked%)  - Handle to the "check" bitmap. 
  1105.     Returns: TRUE if successful, FALSE if unsuccessful. 
  1106.  There are two different ways to implement bitmaps within Visual Basic. 
  1107.  The first method is using static bitmaps. The other method is using 
  1108.  dynamic bitmaps. 
  1109.  Static bitmaps are bitmaps that are placed within the menu using 
  1110.  static bitmaps. Dynamic bitmaps are bitmaps that are changed during 
  1111.  execution of your program. You may change dynamic bitmap attributes 
  1112.  such as color, size, and text. The sample code below describes how to 
  1113.  perform both types of menus. 
  1114.  Define a menu system using the Menu Design window. Create a menu 
  1115.  system such as the following: 
  1116.     Caption      CtlName      Indented     Index 
  1117.     -------      -------      --------     ----- 
  1118.     BitMenu      TopMenu       No 
  1119.     Sub Menu0    SubMenu       Once         0 
  1120.     Sub Menu1    SubMenu       Once         1 
  1121.     Sub Menu2    SubMenu       Once         2 
  1122.  Create a Picture Control Array with 3 bitmaps. This can be 
  1123.  accomplished by creating 3 picture controls with the same CtlName 
  1124.  using the Properties list box. 
  1125.     Caption      CtlName       Index     FontSize 
  1126.     -------      -------       -----     -------- 
  1127.     Picture0     Picture1       0        Set different 
  1128.     Picture1     Picture1       1        font sizes for 
  1129.     Picture2     Picture1       2        each of the pictures 
  1130.  Both types of bitmap implementations will need to have the following 
  1131.  declarations in the declaration or global section of your code: 
  1132.  Declare Function GetMenu% Lib "user" (ByVal hwnd%) 
  1133.  Declare Function GetSubMenu% Lib "user" (ByVal hMenu%, ByVal nPos%) 
  1134.  Declare Function GetMenuItemID% Lib "user" (ByVal hMenu%, ByVal, 
  1135.                                              nPos%) 
  1136.  Declare Function ModifyMenu% Lib "user" (ByVal hMenu%, 
  1137.                             ByVal nPosition%, ByVal wFlags%, 
  1138.                             ByVal wIDNewItem%, ByVal lpNewItem&) 
  1139.  Declare Function SetMenuItemBitmaps% Lib "user" (ByVal hMenu%, 
  1140.                        ByVal nPosition%, ByVal wFlags%, 
  1141.                        ByVal hBitmapUnchecked%, ByVal BitmapChecked%) 
  1142.  ' NOTE: Each Declare statement above must be on just one line. 
  1143.  Const MF_BITMAP = &H4 
  1144.  Const CLR_MENUBAR = &H80000004   ' Defined for dynamic bitmaps only. 
  1145.  Const TRUE = -1, FALSE = 0 
  1146.  Const Number_of_Menu_Selections = 3 
  1147.  The following Sub will also need to be defined to handle the actual 
  1148.  redefinition of the "check" bitmap: 
  1149.  Sub SubMenu_Click (Index As Integer) 
  1150.  ' Uncheck presently checked item, check new item, store index 
  1151.    Static LastSelection% 
  1152.    SubMenu(LastSelection%).Checked = FALSE 
  1153.    SubMenu(Index).Checked = TRUE 
  1154.    LastSelection% = Index 
  1155.  End Sub 
  1156.  The following examples show the two ways to implement the Dynamic and 
  1157.  Static menu bitmaps. 
  1158.  Static Bitmap Menus 
  1159.  ------------------- 
  1160.  Add the code listed below to the appropriate Sub: 
  1161.  Sub Form_Load () 
  1162.     ' Get the handle to the top level Menu 
  1163.     hMenu% = GetMenu(hwnd) 
  1164.     ' Get the handle to the SubMenu of top level Menu 
  1165.     hSubMenu% = GetSubMenu(hMenu%, 0) 
  1166.     For I% = 0 To Number_of_Menu_Selections - 1 
  1167.        ' get the handle to the specific item in SubMenu 
  1168.        menuID% = GetMenuItemID(hSubMenu%, I%) 
  1169.        ' Place the bitmap into the I'th submenu location 
  1170.        X% = ModifyMenu(hMenu%, menuID%, MF_BITMAP, menuID%, 
  1171.                                 CLng(picture1(I%).Picture)) 
  1172.        ' Assign bitmap for the check mark to the I'th submenu 
  1173.        X% = SetMenuItemBitmaps(hMenu%, menuID%, 0, 0, 
  1174.                                CLng(picture2.Picture)) 
  1175.     Next I% 
  1176.  End Sub 
  1177.  Dynamic Bitmap Menus 
  1178.  -------------------- 
  1179.  This code sample will change the actual menu bitmaps size, font size, 
  1180.  color, and caption. Run the application and select the BitMenu and 
  1181.  view the selections. Then click on the form and revisit the BitMenu. 
  1182.  Sub Form_Click () 
  1183.    For i% = 0 To Number_of_Menu_Selections 
  1184.    '* Place some text into the menu. 
  1185.       SubMenu(i%).Caption = Picture1(i%).FontName + 
  1186.                             Str$(Picture1(i%).FontSize) + " Pnt" 
  1187.    '* 1. Must be AutoRedraw for Image(). 
  1188.    '* 2. Set Backcolor of Picture control to that of the 
  1189.    '*    current system Menu Bar color, so Dynamic bitmaps 
  1190.    '*    will appear as normal menu items when menu bar 
  1191.    '*    color is changed via the control panel 
  1192.    '* 3. See the bitmaps on screen, this could all be done at design 
  1193.    '*    time. 
  1194.      Picture1(i%).AutoRedraw = TRUE 
  1195.      Picture1(i%).BackColor = CLR_MENUBAR 
  1196.      Picture1(i%).Visible = FALSE 
  1197.    '* Set the width and height of the Picture controls 
  1198.    '* based on their corresponding Menu items caption, 
  1199.    '* and the Picture controls Font and FontSize. 
  1200.    '* DoEvents() is necessary to make new dimension 
  1201.    '* values to take affect prior to exiting this Sub. 
  1202.     Picture1(i%).Width = Picture1(i%).TextWidth(SubMenu(i%).Caption) 
  1203.     Picture1(i%).Height =Picture1(i%).TextHeight(SubMenu(i%).Caption) 
  1204.     Picture1(i%).Print SubMenu(i%).Caption 
  1205.    '* - Set picture controls backgroup picture (Bitmap) to its Image. 
  1206.      Picture1(i%).Picture = Picture1(i%).Image 
  1207.      X% = DoEvents() 
  1208.    Next i% 
  1209.     '* Get handle to forms menu. 
  1210.    hMenu% = GetMenu(Form1.hwnd) 
  1211.    '* Get handle to the specific menu in top level menu. 
  1212.    hSubMenu% = GetSubMenu(hMenu%, 0) 
  1213.    For i% = 0 To Number_of_Menu_Selections 
  1214.    '* Get ID of sub menu 
  1215.      menuID% = GetMenuItemID(hSubMenu%, i%) 
  1216.    '* Replace menu text w/bitmap from corresponding picture control 
  1217.      X% = ModifyMenu(hMenu%, menuID%, MF_BITMAP, menuID%, 
  1218.                      CLng(Picture1(i%).Picture)) 
  1219.    '* Replace bitmap for menu check mark with custom check bitmap 
  1220.      X% = SetMenuItemBitmaps(hMenu%, menuID%, 0, 0, 
  1221.                      CLng(picture2.Picture)) 
  1222.    Next i% 
  1223.  End Sub 
  1224.  
  1225. Knowledge Base
  1226.  
  1227. Title: How to Create Rubber-Band Lines/Boxes in Visual Basic 
  1228. Document Number: Q71488           Publ Date: 20-MAY-1991 
  1229. Product Name: Microsoft Visual Basic 
  1230. Product Version:  1.00 
  1231. Operating System: WINDOWS 
  1232.  
  1233.  Summary: 
  1234.  Creating rubber bands within Visual Basic can be done using the 
  1235.  DrawMode property. Rubber bands are lines that stretch as you move the 
  1236.  mouse cursor from a specified point to a new location. This can be 
  1237.  very useful in graphics programs and when defining sections of the 
  1238.  screen for clipping routines. 
  1239.  This information applies to Microsoft Visual Basic Programming System 
  1240.  version 1.00 for Windows. 
  1241.  More Information: 
  1242.  The theory of drawing a rubber-band box is as follows: 
  1243.  1. Draw a line from the initial point to the location of the mouse 
  1244.     cursor using: 
  1245.        [form|.DrawMode = 6. {INVERT} 
  1246.  2. Move the mouse cursor. 
  1247.  3. Save the DrawMode. 
  1248.  4. Set the [form|.DrawMode to 6. {INVERT} 
  1249.  5. Draw the same line that was drawn in step 1. This will restore the 
  1250.     image underneath the line. 
  1251.  6. Set the [form|.DrawMode back to the initial DrawMode saved in step 
  1252.     3. 
  1253.  7. Repeat the cycle again. 
  1254.  DrawMode equal to INVERT allows the line to be created using the 
  1255.  inverse of the background color. This allows the line to be always 
  1256.  displayed on all colors. 
  1257.  The sample below will demonstrate the rubber-band line and the 
  1258.  rubber-band box. Clicking on the command buttons will allow the user 
  1259.  to select between rubber-band line or a rubber-band box. The user will 
  1260.  also be able to select a solid line or a dashed line. 
  1261.  Create and set the following controls and properties: 
  1262.     CtlName       Caption          Picture 
  1263.     -------       -------          ------- 
  1264.     Form1         Form1            c:\windows\chess.bmp 
  1265.     Command1      RubberBand 
  1266.     Command2      RubberBox 
  1267.     Command3      Dotted 
  1268.     Command4      Solid 
  1269.  In the general section of your code, define the following constants: 
  1270.  Const INVERSE = 6       '*Characteristic of DrawMode property(XOR). 
  1271.  Const SOLID = 0         '*Characteristic of DrawStyle property. 
  1272.  Const DOT = 2           '*Characteristic of DrawStyle property. 
  1273.  Const TRUE = -1 
  1274.  Const FALSE = 0 
  1275.  Dim DrawBox As Integer  '*Boolean-whether drawing Box or Line 
  1276.  Dim OldX, OldY, StartX, StartY As Single  '* Mouse locations 
  1277.  In the appropriate procedures, add the following code: 
  1278.  Sub Form_MouseDown (Button As Integer, Shift As Integer, X As 
  1279.                                         Single, Y As Single) 
  1280.     '* Store the initial start of the line to draw. 
  1281.     StartX = X 
  1282.     StartY = Y 
  1283.     '* Make the last location equal the starting location 
  1284.     OldX = StartX 
  1285.     OldY = StartY 
  1286.  End Sub 
  1287.  Sub Form_MouseMove (Button As Integer, Shift As Integer, X As 
  1288.                        Single, Y As Single) 
  1289.     '* If the button is depressed then... 
  1290.     If Button Then 
  1291.        '* Erase the previous line. 
  1292.        Call DrawLine(StartX, StartY, OldX, OldY) 
  1293.        '* Draw the new line. 
  1294.        Call DrawLine(StartX, StartY, X, Y) 
  1295.        '* Save the coordinates for the next call. 
  1296.        OldX = X 
  1297.        OldY = Y 
  1298.     End If 
  1299.  End Sub 
  1300.  Sub DrawLine (X1, Y1, X2, Y2 As Single) 
  1301.     '* Save the current mode so that you can reset it on 
  1302.     '* exit from this sub routine. Not needed in the sample 
  1303.     '* but would need it if you are not sure what the 
  1304.     '* DrawMode was on entry to this procedure. 
  1305.     SavedMode% = DrawMode 
  1306.     '* Set to XOR 
  1307.     DrawMode = INVERSE 
  1308.     '*Draw a box or line 
  1309.     If DrawBox Then 
  1310.        Line (X1, Y1)-(X2, Y2), , B 
  1311.     Else 
  1312.        Line (X1, Y1)-(X2, Y2) 
  1313.     End If 
  1314.     '* Reset the DrawMode 
  1315.     DrawMode = SavedMode% 
  1316.  End Sub 
  1317.  Sub Form_MouseUp (Button As Integer, Shift As Integer, X As Single, 
  1318.                    Y As Single) 
  1319.     '* Stop drawing lines/boxes. 
  1320.     StartEvent = FALSE 
  1321.  End Sub 
  1322.  Sub Command2_Click () 
  1323.     '* Boolean value to determine whether to draw a line or box. 
  1324.     DrawBox = TRUE 
  1325.  End Sub 
  1326.  Sub Command1_Click () 
  1327.     '* Boolean value to determine whether to draw a line or box. 
  1328.     DrawBox = FALSE 
  1329.  End Sub 
  1330.  Sub Command3_Click () 
  1331.     '* Create a dotted line 
  1332.     Form1.DrawStyle = DOT 
  1333.  End Sub 
  1334.  Sub Command4_Click () 
  1335.     '* Create a solid line. 
  1336.     Form1.DrawStyle = SOLID 
  1337.  End Sub 
  1338.  
  1339. Knowledge Base
  1340.  
  1341. Title: Visual Basic Support Service Letter, BL0356; Phone Policies 
  1342. Document Number: Q72264           Publ Date: 30-MAY-1991 
  1343. Product Name: Microsoft Visual Basic 
  1344. Product Version:  1.00 
  1345. Operating System: WINDOWS 
  1346.  
  1347.  Summary: 
  1348.  Below is the letter that Microsoft sends in response to customers who 
  1349.  want to know what Microsoft support services are available for Visual 
  1350.  Basic. 
  1351.  This form letter is sent out from Microsoft Product Support Services 
  1352.  (PSS) as the following application note: 
  1353.     BL0356  "Visual Basic Support Service Letter" 
  1354.  This information applies to Microsoft Visual Basic version 1.00 
  1355.  programming system for Windows. 
  1356.  More Information: 
  1357.  Note: Page 1 of 2 is shown below for this reply letter. Page 2 of 2, 
  1358.  the "Product Assistance Checklist," is shown in a separate article 
  1359.  found by querying using the following words: 
  1360.     product and assistance and checklist 
  1361.  BL0356  "Visual Basic Support Service Letter" 
  1362.  --------------------------------------------- 
  1363.  Dear Visual Basic Customer: 
  1364.  Thank you for contacting us regarding Microsoft Visual Basic 
  1365.  Programming System for Windows. Although we are unable to respond to 
  1366.  technical questions by letter (unless solicited by Microsoft), we will 
  1367.  forward your questions to our development team. This procedure 
  1368.  provides developers with customer feedback, which will make 
  1369.  Microsoft's products even better. For fast answers to your technical 
  1370.  questions, you may contact Microsoft directly using the following 
  1371.  support services: 
  1372.  1. Microsoft Visual Basic startup service:  (206) 646-5105 
  1373.     8 AM to 5 PM Pacific Time, Monday - Friday (except holidays) 
  1374.     Microsoft is committed to getting you "up and running" with Visual 
  1375.     Basic. On this phone line, a technician will assist you with setup 
  1376.     and installation questions, and provide information on system 
  1377.     requirements, product functionality, and navigating the Visual 
  1378.     Basic environment. Product suggestions and problem reports are 
  1379.     also welcome on this line. This service is free (but normal long- 
  1380.     distance charges are billed by your phone company). 
  1381.  2. Microsoft OnCall(TM) for Visual Basic: 
  1382.     (900) 896-9876 or (206) 646-5106 
  1383.     Extended hours: 6 AM to 6 PM Pacific Time, Monday - Friday (except 
  1384.     holidays) 
  1385.     For "how-to" programming assistance, priority support is available 
  1386.     through this fee-based service. At OnCall for Visual Basic, 
  1387.     technicians will answer questions about writing and debugging code, 
  1388.     fine-tuning programs, error trapping and handling, creating custom 
  1389.     controls, and calling the Windows API from Visual Basic. The rate 
  1390.     for OnCall service is $2 per minute at (900) 896-9876 (billed by 
  1391.     your phone company). 
  1392.     If you are blocked from dialing our 900 phone number, please call 
  1393.     (206) 646-5106, where we charge a credit card fee of $20 per call. 
  1394.     Only Master Card, VISA, and American Express credit cards are 
  1395.     accepted. 
  1396.  3. Microsoft AutoAnswer for Visual Basic:  (206) 646-5107 
  1397.     Available 24 hours a day, 7 days a week 
  1398.     The AutoAnswer automated voice system provides prerecorded answers 
  1399.     to the most commonly asked questions about Visual Basic. 
  1400.     AutoAnswer also provides a voice mail system that allows you to 
  1401.     leave a message with comments on Visual Basic or on Microsoft 
  1402.     Product Support Services. The AutoAnswer service is free (but 
  1403.     normal long-distance charges are billed by your phone company). 
  1404.     The AutoAnswer system is updated periodically. 
  1405.  4. CompuServe Information Service:  VBasic Forum, and the Microsoft 
  1406.     Knowledge Base
  1407.     User feedback and Microsoft technical support are available on the 
  1408.     Microsoft Forum on CompuServe Information Service (CIS), an 
  1409.     independent electronic information service that provides a medium 
  1410.     for public discussion of Microsoft products. CompuServe also 
  1411.     provides access to the Microsoft Knowledge Base, which contains
  1412.     descriptions of known problems and answers to commonly asked 
  1413.     questions. For additional information about CompuServe, please 
  1414.     call (800) 848-8990. 
  1415.  5. For more information on other comprehensive fee-based technical 
  1416.     support options available from Microsoft, call (800) 443-4672. 
  1417.  Thank you for using Microsoft Visual Basic, 
  1418.  Blain Barton 
  1419.  Basic Languages Team Manager 
  1420.  Microsoft Product Support Services                    BL0356, 5/20/91 
  1421.  
  1422. Knowledge Base
  1423.  
  1424. Title: Declare Currency Type to Be Double When Returning from DLL 
  1425. Document Number: Q72274           Publ Date: 30-MAY-1991 
  1426. Product Name: Microsoft Visual Basic 
  1427. Product Version:  1.00 
  1428. Operating System: WINDOWS 
  1429.  
  1430.  Summary: 
  1431.  When using Visual Basic, if you want to pass a parameter to a DLL 
  1432.  routine, or receive a function return value of type Currency from a 
  1433.  DLL routine written in Microsoft C, the parameter or function returned 
  1434.  should be declared as a "double" in the C routine. 
  1435.  Note that C does not support the Basic Currency data type, and 
  1436.  although specifying the parameter as type "double" in C will allow it 
  1437.  to be passed correctly, you will have to write your own C routines to 
  1438.  manipulate the data in the Currency variable. For information on the 
  1439.  internal format of the Currency data type, query using the following 
  1440.  words: 
  1441.     Basic and Currency and internal and format 
  1442.  This information applies to the Microsoft Visual Basic programming 
  1443.  system version 1.00 for Windows. 
  1444.  More Information: 
  1445.  When creating a DLL function that either receives or returns a 
  1446.  Currency data type, it may be useful to include the following 
  1447.  declaration: 
  1448.     typedef double currency; 
  1449.  Based on this typedef, a sample DLL routine to return a currency value 
  1450.  might be declared as follows: 
  1451.     currency FAR pascal foo(...); 
  1452.  
  1453. Knowledge Base
  1454.  
  1455. Title: PR Microsoft Announces Visual Basic at Windows World '91 
  1456. Document Number: Q72312           Publ Date: 22-MAY-1991 
  1457. Product Name: Microsoft News Releases 
  1458. Product Version: 
  1459. Operating System: 
  1460.  
  1461.  Microsoft Announces Visual Basic at Windows World '91 
  1462.  General-Purpose, High-Productivity 
  1463.  Programming System for Microsoft Windows 
  1464.  ATLANTA -- May 20, 1991 -- Microsoft today announced Microsoft(R) 
  1465.  Visual Basic(TM) programming system at the Windows World '91 industry 
  1466.  trade show. Visual Basic is a graphical application development system 
  1467.  for Microsoft Windows(TM) graphical environment version 3.0 that 
  1468.  combines visual design tools with a powerful, general-purpose 
  1469.  programming language and Windows .EXE compiler. It provides a simple 
  1470.  solution to the complex task of creating real Windows-based software 
  1471.  applications. 
  1472.  "We set out to create the fastest, easiest way to program for the 
  1473.  Windows environment," said Bill Gates, Microsoft founder and CEO. "My 
  1474.  goal from the start was to make developing Windows applications as 
  1475.  easy and natural as possible. We also wanted this tool to appeal to a 
  1476.  broad spectrum of people interested in programming for Windows -- from 
  1477.  professional corporate programmers and consultants solving business 
  1478.  problems to independent software vendors and casual programmers." 
  1479.  Visual Basic programming system combines a rich, event-driven 
  1480.  programming model with the world's most widely used programming 
  1481.  language in a tightly integrated package. General development for the 
  1482.  Windows environment is faster than ever. The Visual Basic programming 
  1483.  system provides visual user-interface design capabilities with 
  1484.  powerful general-purpose programming tools, making it easy for any 
  1485.  programmer to create compiled Windows .EXE files that can be freely 
  1486.  distributed without run-time fees or royalties of any kind. 
  1487.  "This is the most important software product of the year, if not the 
  1488.  decade," said Steve Gibson, president of Gibson Research Inc. "It's 
  1489.  the ultimate intellectual tool. Thanks to Visual Basic, both casual 
  1490.  and professional programmers can produce compelling and beautiful 
  1491.  results. Now it's easy to put together real Windows version 3.0 
  1492.  applications." 
  1493.  "We needed to create an application that incorporated Microsoft Word 
  1494.  for Windows and Microsoft Excel," said Craig Ellis, senior programmer 
  1495.  analyst, Reuters Information Systems. "Visual Basic was the tool to do 
  1496.  this. It filled our needs, allowed us to develop a fast and effective 
  1497.  application and cut our development time by more than half. It's a 
  1498.  fantastic product that allowed us to incorporate a family of Microsoft 
  1499.  products into one application." 
  1500.  The Visual Basic programming system can be used to develop any 
  1501.  Windows-based application, including corporate business systems, tools 
  1502.  and utilities, front ends to data (mainframe, server and local) or 
  1503.  commercial Windows software products. It is also useful for 
  1504.  integrating multiple Windows-based applications and for automating 
  1505.  software testing through dynamic data exchange (DDE). 
  1506.  Visual Basic programming system provides visual design tools for 
  1507.  creating the user interface components -- windows and dialogs -- of an 
  1508.  application. A full set of Windows interface components (including 
  1509.  command buttons, text fields, list boxes, pictures, drop-down menus 
  1510.  and file system controls) are created visually, without writing any 
  1511.  code. The forms engine for building the interface incorporates 
  1512.  technology acquired from Cooper Software. A powerful, structured 
  1513.  programming language is then used to add functionality to these 
  1514.  interface components, responding to events that are automatically 
  1515.  trapped by the system. 
  1516.  The Visual Basic language is a derivative of the Microsoft 
  1517.  QuickBasic(TM) modern programming system, modified for the graphical 
  1518.  environment and the event-driven programming language. It uses a 
  1519.  threaded p-code incremental compiler and source-level debugging tools, 
  1520.  including an interactive immediate window, in a tightly integrated 
  1521.  system. 
  1522.  Extensibility 
  1523.  ------------- 
  1524.  Support is provided for DDE, the mechanism for exchanging data with 
  1525.  other Windows-based applications. The Visual Basic system also 
  1526.  supports dynamic link libraries (DLLs), which allow the user to 
  1527.  establish links with other Windows systems facilities and call the 
  1528.  Windows API or routines written in other languages and compiled into 
  1529.  DLLs. The control set itself can be extended by developers using C and 
  1530.  the Windows SDK and the Microsoft Visual Basic Control Development 
  1531.  Kit, available separately. This extensibility will provide the ability 
  1532.  to fully integrate new user interface components into the graphical 
  1533.  design and code development environment. Examples could include 
  1534.  multimedia, pen controls and data access. 
  1535.  Printed documentation and online Help provide step-by-step 
  1536.  instructions for writing programs. The online Help system provides 
  1537.  context-sensitive reference information and sample code that can be 
  1538.  copied and pasted into a Visual Basic program. An icon library of 
  1539.  approximately 400 designs and an icon editor written in Visual Basic 
  1540.  language are also included. "The built-in help is excellent," said Lee 
  1541.  Perryman, deputy director of Associated Press Broadcast Services in 
  1542.  Washington, D.C. "The debugging features are superb, and the controls 
  1543.  are rich and feature-packed. Because there is almost no learning curve 
  1544.  for users familiar with the Basic language, Visual Basic makes Windows 
  1545.  programming a snap." 
  1546.  Visual Basic programming system for Windows will be available in June 
  1547.  1991 for a suggested retail price* of $199. German and French versions 
  1548.  are expected to ship in August, with other foreign language versions 
  1549.  to follow. 
  1550.  The Visual Basic programming system runs in either the standard or 
  1551.  enhanced mode of Microsoft Windows graphical environment version 3.0 
  1552.  or higher. The system requirements include a personal computer using 
  1553.  80286 processor or higher; hard disk; mouse; CGA, EGA, VGA, 8514, 
  1554.  Hercules(R) or compatible display; MS-DOS(R) operating system version 
  1555.  3.1 or later and one or more megabyte of memory. 
  1556.  Microsoft Corporation (NASDAQ "MSFT") develops, markets and supports a 
  1557.  wide range of software for business and professional use, including 
  1558.  operating systems, network products, languages and applications as 
  1559.  well as books, CD-ROM products and hardware for the microcomputer 
  1560.  marketplace. 
  1561.  *Prices listed are U.S. suggested retail prices. 
  1562.  ### 
  1563.  Microsoft, the Microsoft logo and MS-DOS are registered trademarks and 
  1564.  Microsoft QuickBasic, Visual Basic and Windows are trademarks of 
  1565.  Microsoft Corporation. 
  1566.  Hercules is a registered trademark of Hercules Computer Technology. 
  1567.  For pricing and availability outside the U.S., please contact your 
  1568.  local subsidiary. 
  1569.  
  1570. Knowledge Base
  1571.  
  1572. Title: PR MS Announces Visual Basic Control Development Kit 
  1573. Document Number: Q72313           Publ Date: 22-MAY-1991 
  1574. Product Name: Microsoft News Releases 
  1575. Product Version: 
  1576. Operating System: 
  1577.  
  1578.  Control Development Kit Lets Developers 
  1579.  Extend Microsoft Visual Basic with New Controls 
  1580.  Redmond, Wash. -- May 20, 1991 -- Microsoft today announced the 
  1581.  Microsoft(R) Visual Basic(TM) Control Development Kit, a kit that 
  1582.  allows software developers to extend the capabilities of the Visual 
  1583.  Basic programming system by developing custom controls for the Visual 
  1584.  Basic Toolbox. Visual Basic is a general-purpose programming system 
  1585.  hosted within the Microsoft Windows(TM) graphical environment that 
  1586.  lets programmers quickly develop new applications for that 
  1587.  environment. 
  1588.  Custom controls created with the Control Development Kit can provide 
  1589.  new visual interface elements, trap events and add functionality -- 
  1590.  just like the built-in controls that come with the product. Once the 
  1591.  custom controls are loaded into a project, they are available for use 
  1592.  along with the standard controls. 
  1593.  Standard Toolbox controls include such items as command buttons, 
  1594.  option buttons, text boxes, check boxes, scroll bars, timers and file 
  1595.  system controls. Possible custom controls that third parties could 
  1596.  develop with the Control Development Kit include controls for data 
  1597.  access, multimedia environments, and Microsoft Windows for Pen 
  1598.  Computing. For example, they might develop custom SQL Server controls 
  1599.  that trap messages from the server; animation, video and sound 
  1600.  controls for multimedia PCs; and controls for handwriting input and 
  1601.  recognition for the Windows for Pen environment. Custom controls are 
  1602.  written in C; developers using the Control Development Kit must also 
  1603.  be familiar with the Windows application programming interface (API). 
  1604.  "Visual Basic will make Windows programming much more accessible, 
  1605.  allowing millions of programmers to create their own Windows 
  1606.  programs," said Tom Button, product marketing manager for the 
  1607.  Microsoft applications programmability group. "Now, with the Control 
  1608.  Development Kit, third-party software developers can participate in 
  1609.  and help define this new opportunity. Visual Basic programmers will 
  1610.  also benefit from the development of custom controls, since these 
  1611.  controls will provide more options for application development." 
  1612.  Beta sites for the Control Development Kit are also enthusiastic about 
  1613.  the product. "I think Visual Basic is going to be a very successful 
  1614.  product -- and a key factor in its success is the fact that it's so 
  1615.  incredibly extensible," said Daniel Appleman, president of Desaware, a 
  1616.  software company based in San Jose, California. "With the standard 
  1617.  product, you get a set of built-in controls that are very useful; with 
  1618.  the Control Development Kit, you get the ability to add virtually any 
  1619.  control you want. And, once they've been added, the custom controls 
  1620.  are just as easy to use as the built-in ones." 
  1621.  The Visual Basic Control Development Kit includes 5.25- and 3.5-inch 
  1622.  disks, plus documentation. It requires the Visual Basic programming 
  1623.  system, the Microsoft Windows Software Development Kit (version 3.0 or 
  1624.  later) and the Microsoft C compiler (version 6.0 or later). The kit 
  1625.  will be available from Microsoft in June for $49.95* plus shipping, 
  1626.  handling and applicable sales tax. 
  1627.  Microsoft Corporation (NASDAQ "MSFT") develops, markets and supports a 
  1628.  wide range of software for business and professional use, including 
  1629.  operating systems, network products, languages and applications as 
  1630.  well as books, CD-ROM products and hardware for the microcomputer 
  1631.  marketplace. 
  1632.  *Prices listed are U.S. suggested retail prices. 
  1633.  ### 
  1634.  Microsoft and the Microsoft logo are registered trademarks and Visual 
  1635.  Basic and Windows are trademarks of Microsoft Corporation. 
  1636.  For pricing and availability outside the U.S., please contact your 
  1637.  local subsidiary. 
  1638.  
  1639. Knowledge Base
  1640.  
  1641. Title: PR Windows-Based Visual Basic SDK for SQL Server Announced 
  1642. Document Number: Q72315           Publ Date: 22-MAY-1991 
  1643. Product Name: Microsoft News Releases 
  1644. Product Version: 
  1645. Operating System: 
  1646.  
  1647.  Microsoft Announces Windows-Based Visual 
  1648.  Basic Software Development Kit for SQL Server 
  1649.  ATLANTA -- May 20, 1991 -- Microsoft Corporation today announced 
  1650.  Visual Basic(TM) Library and Software Development Kit (SDK) for 
  1651.  Microsoft(R) SQL Server. Visual Basic programmers can quickly develop 
  1652.  rich Microsoft Windows(TM) graphical environment-based client-server 
  1653.  applications for Microsoft SQL Server, the company's intelligent 
  1654.  database server for PC networks. 
  1655.  Developers wanting to take advantage of the Microsoft Windows 
  1656.  graphical environment and Microsoft SQL Server can now use the Visual 
  1657.  Basic SDK to build line-of-business or decision support applications 
  1658.  that require a robust multiuser database server. Developers can also 
  1659.  use Visual Basic Library for SQL Server with the Database Gateway(TM) 
  1660.  from Micro Decisionware, Boulder, Colo., to build graphical 
  1661.  applications that tap DB2(TM) and other IBM(R) mainframe data sources. 
  1662.  "Visual Basic programming system is an exciting tool for building rich 
  1663.  Windows-based client-server applications on SQL Server," said Dwayne 
  1664.  Walker, group business manager, server applications group at 
  1665.  Microsoft. "For some time now, our customers have been asking for such 
  1666.  a tool to develop prototypes and custom applications around SQL 
  1667.  Server." 
  1668.  Visual Basic Library for SQL Server is built on the standard SQL 
  1669.  Server application programming interface (API) called DB-Library(TM). 
  1670.  To date, Microsoft has provided language support for C, Basic, and 
  1671.  COBOL. Visual Basic Library for SQL Server adds another language to 
  1672.  the list of those that can be used to develop applications for SQL 
  1673.  Server. 
  1674.  Visual Basic Library for SQL Server will be available as a Software 
  1675.  Development Kit by June 30, 1991. The product will contain the 
  1676.  programming libraries, a preliminary documentation set and a copy of 
  1677.  Visual Basic programming system. It will be available directly from 
  1678.  Microsoft for $495*. 
  1679.  The Visual Basic system is a graphical application development system 
  1680.  for Microsoft Windows graphical environment version 3.0 that combines 
  1681.  visual design tools with a powerful, general-purpose programming 
  1682.  language and Windows .EXE compiler. It provides a simple solution to 
  1683.  the complex task of creating real Windows-based software applications. 
  1684.  Microsoft SQL Server is an intelligent client-server relational 
  1685.  database management system (RDBMS) for PC networks. Providing 
  1686.  capabilities previously the exclusive domain of mainframe and 
  1687.  minicomputer systems, Microsoft SQL Server brings high-end 
  1688.  performance, security, and data integrity to local area networks, 
  1689.  allowing data to be shared safely among many applications and users. 
  1690.  Microsoft SQL Server is supported by popular networks such as 
  1691.  Microsoft LAN Manager, Novell(R) NetWare(R) and IBM LAN Server. 
  1692.  Microsoft Corporation (NASDAQ "MSFT") develops, markets, and supports 
  1693.  a wide range of microcomputer software for business and professional 
  1694.  use, including operating systems, languages and applications, as well 
  1695.  as books, hardware and CD-ROM products for the microcomputer 
  1696.  marketplace. 
  1697.  *Prices listed are U.S. suggested retail prices. 
  1698.  ### 
  1699.  Microsoft and the Microsoft logo are registered trademarks and Visual 
  1700.  Basic and Windows are trademarks of Microsoft Corporation. 
  1701.  Database Gateway is a trademark of Micro Decisionware. 
  1702.  DB-Library is a trademark of Sybase, Inc. 
  1703.  IBM is a registered trademark and DB2 is a trademark of International 
  1704.  Business Machines Corporation. 
  1705.  Novell and NetWare are registered trademarks of Novell, Inc. 
  1706.  For pricing and availability outside the U.S., please contact your 
  1707.  local subsidiary. 
  1708.  
  1709. Knowledge Base
  1710.  
  1711. Title: PR Microsoft Visual Basic 
  1712. Document Number: Q72316           Publ Date: 22-MAY-1991 
  1713. Product Name: Microsoft News Releases 
  1714. Product Version: 
  1715. Operating System: 
  1716.  
  1717.  Microsoft Visual Basic 
  1718.  May 1991 
  1719.  Introduction 
  1720.  ------------ 
  1721.  The Microsoft(R) Windows(TM) graphical environment offers many 
  1722.  benefits to end users -- ease of use, user interface consistency, 
  1723.  interapplication integration -- but poses new challenges for 
  1724.  programmers. Writing Windows applications poses a challenge to 
  1725.  programmers because the available development tools lack the very 
  1726.  combination of functionality and ease of use that the applications 
  1727.  themselves feature. 
  1728.  Tools for Developing Graphical Applications 
  1729.  ------------------------------------------- 
  1730.  Microsoft Windows applications make doing powerful things easy. The 
  1731.  Microsoft Visual Basic(TM) programming system creates applications 
  1732.  that tap into such Windows functionality as rich forms and controls, 
  1733.  pull-down menus, graphics and animation, dynamic data exchange (DDE) 
  1734.  and multi-tasking. These are difficult for Windows programmers using 
  1735.  traditional tools to develop, but very easy to achieve in the 
  1736.  Microsoft Visual Basic programming system. In general, software 
  1737.  development tools have resided at either end of a spectrum, and each 
  1738.  extreme forced developers to make tradeoffs. High-level tools allow 
  1739.  faster development, which is paid for in reduced flexibility and 
  1740.  control and greater runtime overhead. Low-level tools provide better 
  1741.  control and less overhead, but require more programming skill. Thus, 
  1742.  choosing a tool often involves making an undesirable compromise. 
  1743.  Microsoft Visual Basic: Real Windows Applications Really Fast 
  1744.  ------------------------------------------------------------- 
  1745.  Microsoft Visual Basic programming system is a general-purpose 
  1746.  graphical application development system for the Microsoft Windows 
  1747.  environment that bridges the extremes of the tool spectrum described 
  1748.  above. The Visual Basic system addresses the need for a Windows 
  1749.  programming solution that is both serious and easy to use. It is 
  1750.  specifically designed to accelerate Windows version 3.0 development by 
  1751.  harnessing the power of the graphical environment to make mainstream 
  1752.  programmers more productive. Visual Basic helps programmers create 
  1753.  real Windows applications real fast. Extremely easy to use, it is the 
  1754.  ultimate productivity tool. 
  1755.  Visual Basic Key Features 
  1756.  ------------------------- 
  1757.  The following is a description of the key features of the Microsoft 
  1758.  Visual Basic programming system. 
  1759.  Visual Design Tools for the User Interface 
  1760.  ------------------------------------------ 
  1761.  The Visual Basic system offers rich design tools that enable the 
  1762.  visual components of an application to be designed with drawing tools. 
  1763.  No code is required to create graphical user interfaces. Programs are 
  1764.  designed, created and run within the target Windows environment. 
  1765.  With Visual Basic programming system, windows and dialog boxes are 
  1766.  designed visually by selecting a tool from the Toolbox of controls and 
  1767.  then placing and sizing them on a form. All the Windows controls are 
  1768.  included in the Toolbox: command buttons, option buttons, check boxes, 
  1769.  simple and drop-down list boxes and combo boxes, text fields, labels 
  1770.  (static text), pictures (that can display icons, bitmaps, Windows 
  1771.  metafiles and programmatic graphics), Frame (to visually and 
  1772.  functionally group controls), Timer (that responds to the system 
  1773.  clock), scroll bars, and file system controls (drives, directory and 
  1774.  file list boxes). These controls have the appearance and behavior of 
  1775.  Windows controls such as three-dimensional command buttons that push 
  1776.  in and out, scroll bars that scroll, and edit fields that accept text 
  1777.  input and support cutting and pasting without writing any code. 
  1778.  Visual design tools are also used to set the attributes of a form's 
  1779.  appearance and behavior, from within the Visual Basic environment. The 
  1780.  Property Bar provides a list of available properties for each type of 
  1781.  control. A color palette offers a visual way to assign color 
  1782.  properties. Menus, complete with access keys and accelerators, are 
  1783.  created in outlining fashion in a menu design window. A project or 
  1784.  application can include many forms. 
  1785.  A Structured, Powerful Programming Language 
  1786.  ------------------------------------------- 
  1787.  The Visual Basic language is a powerful, structured, general-purpose 
  1788.  programming language. It is a derivative of the Microsoft 
  1789.  QuickBasic(TM) modern programming system. Visual Basic language offers 
  1790.  all the modern programming structures such as Subs and Functions, 
  1791.  Block If...Then...Else..., Select Case, Do While/Until, For/Next and 
  1792.  error trapping with an easy-to-learn syntax. 
  1793.  An Event-Driven Programming Model 
  1794.  --------------------------------- 
  1795.  The Visual Basic system introduces a high-level, event-driven 
  1796.  programming model that is especially suited for programming in a 
  1797.  graphical environment. Events such as mouse clicks and key presses are 
  1798.  automatically detected and processed by the system. The Visual Basic 
  1799.  programmer doesn't need to deal with event trapping or Windows message 
  1800.  dispatching and can simply tell the Visual Basic application how to 
  1801.  respond to a specific recognized event on a particular form or 
  1802.  control. The Visual Basic system's visual design tools, combined with 
  1803.  its event-driven nature, free the programmer to think of how the 
  1804.  application should look and behave, instead of having to concentrate 
  1805.  on lower-level system events or coding the user interface. 
  1806.  A Fast, Responsive Coding and Debugging Environment 
  1807.  --------------------------------------------------- 
  1808.  The Microsoft Visual Basic programming system's combination of an 
  1809.  intuitive front-end building tool with an easy-to-learn programming 
  1810.  language creates a highly productive development environment. 
  1811.  Further productivity is realized by the system's threaded p-code 
  1812.  incremental compiler, a technology first introduced in Microsoft 
  1813.  QuickBasic programming system version 4.0 in 1987. Each line of code 
  1814.  is automatically parsed and incrementally compiled as soon as it is 
  1815.  typed in. Syntax errors are trapped immediately, alerting the 
  1816.  programmer to any syntax problem. The incremental compilation allows a 
  1817.  very fast transition from Design mode to Run mode. Break mode is also 
  1818.  available when the program encounters a runtime error or a breakpoint 
  1819.  in the code. The programmer can then single-step or procedure-step 
  1820.  through the application. The programmer also can set the next 
  1821.  statement to be executed anywhere within a procedure. An Immediate 
  1822.  window lets the programmer interact with the application while it is 
  1823.  temporarily suspended in the running state. The programmer can check 
  1824.  or even change the value of a variable, or enter any valid line of 
  1825.  code, which is directly executed without affecting the source code. 
  1826.  The programmer can then copy code entered in the Immediate window to 
  1827.  the Code window, to be included in the program's source code. This 
  1828.  revolutionary technology, first introduced in Microsoft QuickBasic 
  1829.  system version 4.0, is the threaded p-code incremental compiler. 
  1830.  For additional productivity, help is readily available in both online 
  1831.  and printed form. A detailed computer-based tutorial gets the user up 
  1832.  and running fast, and manuals (Programmer's Guide and Language 
  1833.  Reference) provide further training and reference materials. Context- 
  1834.  sensitive online Help provides readily available reference information 
  1835.  on the programming language and environment. Code examples from Help 
  1836.  can be copied and pasted to an application's source listing. 
  1837.  The Ability to Create Real Windows .EXE Files 
  1838.  When a program is designed, coded, debugged and fully functional, the 
  1839.  programmer simply chooses Make EXE File from the File menu to create 
  1840.  an .EXE file that can be freely distributed, without any royalties or 
  1841.  runtime fees. .EXE files can have all the features generally 
  1842.  associated with Microsoft Windows programs, such as multiple windows, 
  1843.  pull-down menus, standard controls (command buttons, text fields, 
  1844.  option buttons), graphics and icons, drag-and-drop and DDE. 
  1845.  Interoperability and Extensibility 
  1846.  ---------------------------------- 
  1847.  Microsoft Visual Basic programming system gives programmers access to 
  1848.  DDE and dynamic link libraries (DLLs) for interoperability and 
  1849.  extensibility with other applications. Interapplication communication 
  1850.  and integration is available via DDE. Visual Basic applications can be 
  1851.  DDE clients, servers or both. The environment offers high-level DDE 
  1852.  (paste-link) as well as programmable DDE in the language. Visual Basic 
  1853.  environment includes a rich set of DDE events (LinkOpen, LinkClose, 
  1854.  LinkExecute, LinkError), properties (LinkMode, LinkTopic, LinkItem, 
  1855.  LinkTimeout), and methods (LinkExecute, LinkPoke, LinkRequest, 
  1856.  LinkSend). 
  1857.  Visual Basic programmers can access external routines in DLLs, 
  1858.  including directly calling the Windows API (applications programming 
  1859.  interface). This is accomplished with a very straightforward syntax. A 
  1860.  one-line Function or Sub Declaration is all that is required to use an 
  1861.  external DLL routine as though it were built into the Visual Basic 
  1862.  system's language. 
  1863.  Users can gain powerful additional functionality by extending the 
  1864.  Microsoft Visual Basic development environment with custom controls. 
  1865.  Microsoft has separately announced the Visual Basic Control 
  1866.  Development Kit, which allows Windows developers to create extensions 
  1867.  to the Visual Basic system. Custom controls can have predefined 
  1868.  properties and events and some built-in functionality, just like the 
  1869.  standard controls in the Visual Basic Toolbox. A Visual Basic 
  1870.  programmer can load a custom control into a project, then assign 
  1871.  properties and write code for it just as though it were a built-in 
  1872.  control. Custom controls, like the standard ones, can trap events and 
  1873.  call the appropriate event procedures written in Visual Basic 
  1874.  language. This mechanism allows the Visual Basic environment to be 
  1875.  extended in many different ways, providing custom user-interface 
  1876.  components and specialized functionality such as multimedia, data 
  1877.  access or communications capabilities. 
  1878.  Visual Basic For High Productivity 
  1879.  ---------------------------------- 
  1880.  Visual Basic programming system is designed to make Windows 
  1881.  application developers more productive regardless of skill level or 
  1882.  application complexity. Its tightly integrated graphical development 
  1883.  environment helps move applications from concept to executable code in 
  1884.  the shortest possible time. 
  1885.  The Visual Basic User 
  1886.  --------------------- 
  1887.  Users of the Microsoft Visual Basic system have the common task of 
  1888.  creating Windows applications, although they come to it with different 
  1889.  backgrounds and skills. They are professional programmers working with 
  1890.  small ISVs, VARs and system integrators; part-time programmers, 
  1891.  including engineers, scientists, analysts and educators; corporate 
  1892.  development staff and MIS professionals; and general PC "power users" 
  1893.  who want to create their own Windows applications. Visual Basic system 
  1894.  doesn't require programming experience, but it is helpful if the user 
  1895.  is familiar with general programming concepts. Anyone who has written 
  1896.  a macro or batch file, or has programmed in any high-level language, 
  1897.  can be productive very quickly with Microsoft Visual Basic. Using the 
  1898.  Visual Basic system, programmers can carry out a variety of tasks, 
  1899.  including writing standalone GUI applications; integrating 
  1900.  applications; developing application front ends, utilities or tools, 
  1901.  and graphical display-oriented programs; and prototyping. 
  1902.  Summary 
  1903.  ------- 
  1904.  As Microsoft Windows grows in popularity, development environments are 
  1905.  naturally evolving toward graphical hosts, allowing programmers to 
  1906.  realize the productivity benefits of the graphical user interface. 
  1907.  Microsoft Visual Basic programming system is a low-cost (under $200 
  1908.  U.S. suggested retail price) Microsoft Windows-hosted and targeted 
  1909.  development tool that uses an event-driven programming model. It 
  1910.  offers high-level visual design tools to help programmers develop 
  1911.  interfaces. A graphical tool for graphical systems, the Visual Basic 
  1912.  programming system provides a simple solution to the otherwise complex 
  1913.  task of creating and integrating real Windows applications. It is the 
  1914.  only general-purpose, high-productivity programming system for the 
  1915.  Microsoft Windows environment. 
  1916.  ### 
  1917.  Microsoft and the Microsoft logo are registered trademarks and Visual 
  1918.  Basic, Windows and Microsoft QuickBasic are trademarks of Microsoft 
  1919.  Corporation. 
  1920.  For pricing and availability outside the U.S., please contact your 
  1921.  local subsidiary. 
  1922.  
  1923. Knowledge Base
  1924.  
  1925. Title: PR Microsoft Announces Update of FORTRAN Compiler 
  1926. Document Number: Q72560           Publ Date: 30-MAY-1991 
  1927. Product Name: Microsoft News Releases 
  1928. Product Version: 
  1929. Operating System: 
  1930.  
  1931.  Microsoft Announces Update of FORTRAN Compiler 
  1932.  That Taps the Power of Microsoft Windows 
  1933.  REDMOND, Wash. -- May 28, 1991 -- Microsoft today announced the 
  1934.  Microsoft(R) FORTRAN professional development system version 5.1, 
  1935.  bringing the power of the Microsoft Windows(TM) graphical environment 
  1936.  to FORTRAN developers. This new version introduces the QuickWin 
  1937.  library, which allows programmers to port DOS* applications to the 
  1938.  Windows environment without modifying their code. It also supports the 
  1939.  development of Windows DLLs (dynamic link libraries) for inclusion in 
  1940.  mixed-language applications. 
  1941.  New QuickWin Library Turns DOS Programs into Windows Programs 
  1942.  ------------------------------------------------------------- 
  1943.  By providing access to Windows, the QuickWin library allows FORTRAN 
  1944.  applications to take advantage of extended and virtual memory -- over 
  1945.  16 MB on 80386 computers. This is done simply by recompiling DOS 
  1946.  applications in Microsoft FORTRAN and linking them to the Microsoft 
  1947.  QuickWin library. Most 16-bit applications can be moved to the Windows 
  1948.  environment without changes to the source code. Microsoft plans to 
  1949.  incorporate the QuickWin library in other language products as well. 
  1950.  "FORTRAN programs usually require a lot of memory for program and 
  1951.  data," said Fred Gray, general manager of the languages business unit 
  1952.  at Microsoft. "Now programmers can create bigger applications and also 
  1953.  take advantage of the power of the Windows environment." 
  1954.  The QuickWin library provides a fast way to port character-based 
  1955.  FORTRAN applications to the Windows graphical environment, taking 
  1956.  advantage of the advanced features Windows computing offers. For 
  1957.  example, programmers can add custom-sized child windows, window titles 
  1958.  and message boxes to their QuickWin applications. QuickWin 
  1959.  applications can access all memory available under the Windows 
  1960.  environment. "The QuickWin library allows us to expand easily the data 
  1961.  matrices used by our fault tree analysis applications without concern 
  1962.  for running out of memory," said Bill Debus, manager of software 
  1963.  engineering for a major aerospace company. 
  1964.  New Links Facilitate Mixed-Language 
  1965.  Programming in Windows Applications 
  1966.  ----------------------------------- 
  1967.  Programmers can now link FORTRAN object code and dynamic-link 
  1968.  libraries to Windows applications. Existing FORTRAN code can be used 
  1969.  when developing full-featured Windows applications, such as those 
  1970.  written in Microsoft C or with the Microsoft Visual Basic(TM) 
  1971.  programming system. DLLs can also be used as repositories for FORTRAN 
  1972.  algorithms that are shared by multiple Windows applications. 
  1973.  "Being able to reuse our established FORTRAN libraries as Windows DLLs 
  1974.  allows us to speed up migration of our Simusolve modeling software 
  1975.  from host machines to the Windows environment," said Gary Agin, 
  1976.  software developer at the Dow Chemical Company. 
  1977.  Windows Provides Access to Analysis Tools 
  1978.  ----------------------------------------- 
  1979.  The ability to develop Windows-based FORTRAN applications will be 
  1980.  welcomed by Microsoft FORTRAN users, over 50 percent of whom have the 
  1981.  Microsoft Windows environment. The Microsoft Windows environment 
  1982.  allows FORTRAN programmers to exchange data easily with popular 
  1983.  analysis tools that run in the Windows environment, such as Microsoft 
  1984.  Excel. FORTRAN output can be cut-and-pasted into Microsoft Excel or 
  1985.  other Windows charting software for custom graphic display. 
  1986.  VAX, IBM Syntax Compatibility 
  1987.  ----------------------------- 
  1988.  Microsoft's optimizing FORTRAN compiler supports ANSI 77 and numerous 
  1989.  IBM(R), VAX(R) and ANSI 8x extensions. Support for IBM and VAX 
  1990.  extensions is particularly significant for the vast majority of 
  1991.  applications ported to PCs, approximately half of which are from IBM 
  1992.  mainframes and half from the VAX environment. These extensions, along 
  1993.  with the QuickWin technology, may enable the migration of traditional 
  1994.  FORTRAN code in minicomputer and mainframe environments to the Windows 
  1995.  graphical environment. 
  1996.  An Integrated Toolset Speeds Application Development 
  1997.  ---------------------------------------------------- 
  1998.  As with all other Microsoft professional development systems, FORTRAN 
  1999.  professional development system version 5.1 includes a complete set of 
  2000.  integrated tools and utilities for developing programs. This set 
  2001.  includes the Microsoft CodeView(R) debugger, Advisor online help, the 
  2002.  Source Browser and the complete Microsoft Programmer's WorkBench. The 
  2003.  CodeView debugger has been improved to take advantage of extended 
  2004.  memory for debugging large DOS applications, as well as for supporting 
  2005.  Windows and OS/2(R) programs. 
  2006.  Pricing and Availability 
  2007.  ------------------------ 
  2008.  Microsoft FORTRAN professional development system version 5.1 will be 
  2009.  available in June 1991 for a suggested retail price of $450. Licensees 
  2010.  of previous versions of Microsoft FORTRAN can receive an update for 
  2011.  $150 until June 1, 1992. 
  2012.  Microsoft Corporation (NASDAQ "MSFT") develops, markets and supports a 
  2013.  wide range of software for business and professional use, including 
  2014.  operating systems, network products, languages and applications as 
  2015.  well as books, CD-ROM products and hardware for the microcomputer 
  2016.  marketplace 
  2017.  *As used herein, "DOS" refers to the MS-DOSR and PC-DOS operating 
  2018.  systems. 
  2019.  ### 
  2020.  Microsoft, the Microsoft logo, CodeView and MS-DOS are registered 
  2021.  trademarks and Visual Basic and Windows are trademarks of Microsoft 
  2022.  Corporation. 
  2023.  OS/2 is a registered trademark licensed to Microsoft Corporation. 
  2024.  Simusolve is a registered trademark of Dow Chemical Company. 
  2025.  IBM is a registered trademark of International Business Machines 
  2026.  Corporation. 
  2027.  VAX is a registered trademark of Digital Equipment Corporation. 
  2028.  For pricing and availability outside the U.S., please contact your 
  2029.  local subsidiary. 
  2030.  
  2031. Knowledge Base
  2032.  
  2033. Title: PR MS Visual Basic for Windows Wins Overall "Best of Show" 
  2034. Document Number: Q72561           Publ Date: 30-MAY-1991 
  2035. Product Name: Microsoft News Releases 
  2036. Product Version: 
  2037. Operating System: 
  2038.  
  2039.  Microsoft Visual Basic for Windows Wins Overall 
  2040.  "Best of Show" at COMDEX/Spring and Windows World 
  2041.  REDMOND, Wash., -- May 29, 1991 -- "Microsoft Visual Basic represents 
  2042.  the "best of the bests" in a field of hundreds of new introductions at 
  2043.  COMDEX and WINDOWS WORLD," said Fred Langa, editor in chief of BYTE 
  2044.  magazine. Show organizers -- The Interface Group and BYTE magazine 
  2045.  editors -- selected the Visual Basic(TM) programming system as the 
  2046.  most exciting new product which will have the most industry impact. 
  2047.  The Visual Basic system also received the "Best of Spring" award for 
  2048.  the Best Windows(TM) Utility. The Visual Basic programming system is a 
  2049.  graphical application development system for Microsoft(R) Windows 
  2050.  graphical environment version 3.0, and combines visual design tools 
  2051.  with a powerful, general-purpose programming language and Windows .EXE 
  2052.  compiler. 
  2053.  The Visual Basic system was introduced May 21, 1991, at a press 
  2054.  conference attended by more than 600 corporate customers, developers 
  2055.  and journalists. Microsoft founder and CEO Bill Gates forecasts that 
  2056.  many more thousands of Windows applications will be written in the 
  2057.  Visual Basic language. Forty-five independent software developers 
  2058.  announced and demonstrated more than 60 products ranging from custom 
  2059.  controls to add-on DLLs for data access and multimedia applications. 
  2060.  Charles Stevens, general manager of the Microsoft data access business 
  2061.  unit, said "Our goal was to make creating real Windows applications 
  2062.  incredibly easy and fast. This award represents an affirmation of our 
  2063.  strategy of combining a rich set of visual design tools with a 
  2064.  powerful, event-driven programming language to achieve just that. 
  2065.  "We also appreciate the feedback from our customers, independent 
  2066.  software vendors and beta sites that helped us build the product they 
  2067.  wanted and which continue to guide our future directions." 
  2068.  Visual Basic programming system for Windows will be available in June 
  2069.  1991 for a U.S. suggested retail price of $199. German and French 
  2070.  versions are scheduled to ship in August, with other language versions 
  2071.  to follow. 
  2072.  Microsoft Corporation (NASDAQ "MSFT") develops, markets and supports a 
  2073.  wide range of software for business and professional use, including 
  2074.  operating systems, network products, languages and applications as 
  2075.  well as books, CD-ROM products and hardware for the microcomputer 
  2076.  marketplace. 
  2077.  ### 
  2078.  Microsoft and the Microsoft logo are registered trademarks and Visual 
  2079.  Basic and Windows are trademarks of Microsoft Corporation. 
  2080.  For pricing and availability outside the U.S., please contact your 
  2081.  local subsidiary. 
  2082.  
  2083. Knowledge Base
  2084.  
  2085. Title: How to Create Flashing/Rotating Rubber-Band Box in VB 
  2086. Document Number: Q71489           Publ Date: 17-JUN-1991 
  2087. Product Name: Microsoft Visual Basic 
  2088. Product Version:  1.00 
  2089. Operating System: WINDOWS 
  2090.  
  2091.  Summary: 
  2092.  Several programs, such as Excel, create a flashing border (which 
  2093.  appears to rotate) when selecting items of the windows when using the 
  2094.  Edit Copy selection of the menu system. You can create a flashing, 
  2095.  rotating border with the DrawMode and DrawStyle properties of a Visual 
  2096.  Basic form. 
  2097.  This information applies to Microsoft Visual Basic Programming System 
  2098.  version 1.00 for Windows. 
  2099.  More Information: 
  2100.  By drawing a dashed line on the form and then within a timer event 
  2101.  creating a solid line on the dashed line with DrawMode set to INVERSE, 
  2102.  you can create a special effect of a flashing border that appears to 
  2103.  rotate. 
  2104.  You can draw a rotating rubber-band box as follows: 
  2105.  1. Draw a line using: 
  2106.        DrawStyle = 2 {Dot} 
  2107.  2. Save the [form|.DrawMode and the [form|.DrawStyle. 
  2108.  3. Set the [form|.DrawMode = 6 {Inverse}. 
  2109.  4. Set [form|.DrawStyle = 0 {Solid}. 
  2110.  5. Draw the same line as in step 1. 
  2111.  6. Reset the properties saved in step 2. 
  2112.  7. Delay some time interval. 
  2113.  8. Repeat starting at step 2. 
  2114.  The following code demonstrates the rotating (flashing) border. 
  2115.  Pressing the mouse button and then dragging the cursor some distance 
  2116.  will create a dotted line. Releasing the button will display a 
  2117.  rotating rubber-band box. 
  2118.  In VB.EXE, create a form called Form1. On Form1, create a timer 
  2119.  control with the name Timer1 and with an interval of 100. 
  2120.  Duplicate the following code within the general declaration section of 
  2121.  your code window: 
  2122.  Const INVERSE = 6     'Characteristic of DrawStyle property(Inverse). 
  2123.  Const SOLID = 0       'Characteristic of DrawMode property. 
  2124.  Const DOT = 2         'Characteristic of DrawMode property. 
  2125.  Const TRUE = -1 
  2126.  Const FALSE = 0 
  2127.  Dim OldX, OldY, StartX, StartY As Single 
  2128.  Add the following code in the appropriate event procedures for Form1: 
  2129.  Sub Form_Load () 
  2130.     '* Must draw a dotted line to create effect.  Load a bitmap. Not 
  2131.        required but shows full extent of line drawing. 
  2132.     DrawStyle = DOT 
  2133.  End Sub 
  2134.  Sub Timer1_Timer () 
  2135.     SavedDrawStyle% = DrawStyle 
  2136.    '* Solid is need to create the inverse of the dashed line. 
  2137.     DrawStyle = SOLID 
  2138.   '* Invert the dashed line. 
  2139.     Call DrawLine(StartX, StartY, OldX, OldY) 
  2140.    '* Restore the DrawStyle back to what it was previously. 
  2141.     DrawStyle = SavedDrawStyle% 
  2142.  End Sub 
  2143.  Sub Form_MouseDown (Button As Integer, Shift As Integer, X As 
  2144.                                         Single, Y As Single) 
  2145.  ' The above Sub statement must be on just one line. 
  2146.     '* Don't add effect as you draw box. 
  2147.     Timer1.Enabled = FALSE 
  2148.     '* Save the start locations. 
  2149.     StartX = X 
  2150.     StartY = Y 
  2151.     '* Set the last coord. to start locations. 
  2152.     OldX = StartX 
  2153.     OldY = StartY 
  2154.  End Sub 
  2155.  Sub Form_MouseMove (Button As Integer, Shift As Integer, X As 
  2156.                                         Single, Y As Single) 
  2157.  ' (The above Sub statement must be on just one line.) 
  2158.  '* If button is depress then... 
  2159.  If Button Then 
  2160.        '* Restore previous lines background. 
  2161.        Call DrawLine(StartX, StartY, OldX, OldY) 
  2162.        '* Draw new line. 
  2163.        Call DrawLine(StartX, StartY, X, Y) 
  2164.        '* Save coordinates for next call. 
  2165.        OldX = X : OldY = Y 
  2166.     End If 
  2167.  End Sub 
  2168.  Sub DrawLine (X1, Y1, X2, Y2 As Single) 
  2169.     '* Save the current mode so that you can reset it on 
  2170.     '* exit from this sub routine. Not needed in the sample 
  2171.     '* but would need it if you are not sure what the 
  2172.     '* DrawMode was on entry to this procedure. 
  2173.     SavedMode% = DrawMode 
  2174.     '* Set to XOR 
  2175.     DrawMode = INVERSE 
  2176.     '*Draw a box 
  2177.     Line (X1, Y1)-(X2, Y2), , B 
  2178.     '* Reset the DrawMode 
  2179.     DrawMode = SavedMode% 
  2180.  End Sub 
  2181.  Sub Form_MouseUp (Button As Integer, Shift As Integer, X As Single, 
  2182.                                           Y As Single) 
  2183.  ' (The above Sub statement must be on just one line.) 
  2184.     StartEvent = FALSE 
  2185.     Timer1.Enabled = TRUE 
  2186.  End Sub 
  2187.  
  2188. Knowledge Base
  2189.  
  2190. Title: VB Can Determine When a Shelled Process Has Terminated 
  2191. Document Number: Q72880           Publ Date: 17-JUN-1991 
  2192. Product Name: Microsoft Visual Basic 
  2193. Product Version:  1.00 
  2194. Operating System: WINDOWS 
  2195.  
  2196.  Summary: 
  2197.  The Shell function initiates a process and returns back to the Visual 
  2198.  Basic program. The process will continue indefinitely until you decide 
  2199.  to stop it. Terminating the Visual Basic program will not cause the 
  2200.  shelled process to terminate. However, you may not want this behavior 
  2201.  if you want the Visual Basic program to wait until the shelled process 
  2202.  has finished before continuing. This article describes a method by 
  2203.  which a Visual Basic program will wait until a shelled process has 
  2204.  terminated. 
  2205.  This information applies to Microsoft Visual Basic programming system 
  2206.  version 1.0 for Windows. 
  2207.  More Information: 
  2208.  By using the Windows API functions GetActiveWindow and IsWindow, your 
  2209.  program can monitor the status of a shelled process. The API function 
  2210.  GetActiveWindow should be called immediately after the Shell function 
  2211.  to get the window handle of the shelled process. This will work 
  2212.  correctly only if you invoke the Shell function using a window style 
  2213.  with focus, that is, window style 1, 2, or 3. By continually calling 
  2214.  the API function IsWindow from within a While loop, you can cause the 
  2215.  Visual Basic program to wait until the shelled process has terminated. 
  2216.  The Windows API function IsWindow simply checks to make sure that the 
  2217.  window associated with the handle found with GetActiveWindow is still 
  2218.  a valid window. 
  2219.  The Visual Basic program below uses the Shell function to execute 
  2220.  Windows's Calculator accessory. The program is an example of how to 
  2221.  use the Windows API functions GetActiveWindow and IsWindow to wait 
  2222.  until a shelled process has terminated before resuming execution. 
  2223.  Code Example 
  2224.  ------------ 
  2225.  'The Declare statements for Windows API functions need to be included 
  2226.  'in the Declarations section of the form or in the Global module. 
  2227.  'Assume that the following Declare statements are in the Declarations 
  2228.  'section of the default form (Form1). 
  2229.  Declare Function GetActiveWindow% Lib "User" () 
  2230.  Declare Function IsWindow% Lib "User" (ByVal hWnd%) 
  2231.  'Below is the code contained within the Form_Load event procedure of 
  2232.  'the default form (Form1): 
  2233.  Sub Form_Load () 
  2234.      x% = Shell("calc.exe", 1)   ' Must Shell using a Window Style 
  2235.                                  ' with focus, Window style 1, 2, or 3. 
  2236.      ' You must immediately invoke GetActiveWindow%() for this 
  2237.      ' technique to work: 
  2238.      ShellWindowHWnd% = GetActiveWindow%()   'Get the window handle 
  2239.                                              ' of the shelled process. 
  2240.      While IsWindow%(ShellWindowHWnd%)   'Wait until the shelled 
  2241.                                          ' process has been terminated. 
  2242.          x% = DoEvents()        'Process other Windows events. 
  2243.      Wend 
  2244.      End 
  2245.  End Sub 
  2246.  
  2247. Knowledge Base
  2248.  
  2249. Title: How to Set Tab Stops Within a List Box in Visual Basic 
  2250. Document Number: Q71067           Publ Date: 18-JUN-1991 
  2251. Product Name: Microsoft Visual Basic 
  2252. Product Version:  1.00 
  2253. Operating System: WINDOWS 
  2254.  
  2255.  Summary: 
  2256.  Visual Basic does not have any intrinsic function for creating 
  2257.  multi-column list boxes. To create multi-column list boxes, you must 
  2258.  call several Windows API function calls to set tab stops within the 
  2259.  list box. The tab stops create the multi-column effect. 
  2260.  This information applies to Microsoft Visual Basic Programming System 
  2261.  version 1.00 for Windows. 
  2262.  More Information: 
  2263.  Multi-column list boxes can be created by calling several Windows API 
  2264.  function calls. These functions are GetFocus, SendMessage, and 
  2265.  SetFocus. 
  2266.  The function GetFocus requires no parameters. This function will 
  2267.  return an integer value that represents the handle to the control. Use 
  2268.  GetFocus to get the handle to the control that currently has focus 
  2269.  upon entry to the event-handler procedure. After you store the handle 
  2270.  to the control that currently has focus, set the focus to the desired 
  2271.  list box. 
  2272.  After you set the focus to the list box, you must send a message to 
  2273.  the window's message queue that will reset the tab stops of the list 
  2274.  box. Using the argument LB_SETTABSTOPS as the second parameter to 
  2275.  SendMessage will set the desired tab stops for the multi-column list 
  2276.  box based on other arguments to the function. The SendMessage function 
  2277.  requires the following parameters for setting the tab stops 
  2278.     SendMessage (hWnd%,LB_SETTABSTOPS, wParam%, lparam) 
  2279.  where: 
  2280.     wParam%     Is an integer that specifies the number of tab 
  2281.                 stops in the list box. 
  2282.     lParam      Is a long pointer to the first member of an array 
  2283.                 of integers containing the tab stop position in 
  2284.                 dialog units. (A dialog unit is a horizontal or 
  2285.                 vertical distance. One horizontal dialog unit is 
  2286.                 equal to 1/4 of the current dialog base-width unit. 
  2287.                 The dialog base units are computed based on the 
  2288.                 height and the width of the current system font. 
  2289.                 The GetDialogBaseUnits function returns the current 
  2290.                 dialog base units in pixels.)  The tab stops must 
  2291.                 be sorted in increasing order; back tabs are not 
  2292.                 allowed. 
  2293.  After setting the tab stops with the SendMessage function, calling 
  2294.  PutFocus with the saved handle will return the focus back to the 
  2295.  control that had focus before the procedure call. PutFocus is the 
  2296.  Alias for the Windows API SetFocus function. The Windows API SetFocus 
  2297.  needs to be redefined using the "Alias" keyword because SetFocus is a 
  2298.  reserved word within Visual Basic. 
  2299.  To create multi-column list boxes within Visual Basic, create a list 
  2300.  box named Listbox1 on Form1. Declare the following Windows API 
  2301.  functions at the module level or in the Global section of your code as 
  2302.  follows: 
  2303.  Declare Function GetFocus Lib "user" () As Integer 
  2304.  Declare Function SendMessage Lib "user" (ByVal hwnd As Integer, 
  2305.                                           ByVal wMsg As Integer, 
  2306.                                           ByVal wp As Integer, 
  2307.                                           lp As Any) As Long 
  2308.  Declare Function PutFocus Lib "user" Alias "SetFocus" 
  2309.                                           (ByVal hWnd%) As Integer 
  2310.  Note: All Declare statements must each be written out on one line. 
  2311.  Also declare the following constants: 
  2312.  Const WM_USER = &H400 
  2313.  Const LB_SETTABSTOPS = WM_USER + 19 
  2314.  Include the following code within a SUB procedure: 
  2315.  Sub Form_Click () 
  2316.     Static tabs(3) As Integer 
  2317.     hOldWnd% = GetFocus()   'Remember who had the focus. 
  2318.     list1.SetFocus          'Set the focus to the list box. 
  2319.     lbhWnd% = GetFocus()    'Get the handle to the list box. 
  2320.     'Set up the array of defined tab stops. 
  2321.     tabs(1) = 10 
  2322.     tabs(2) = 50 
  2323.     tabs(3) = 90 
  2324.     'Send a message to the message queue. 
  2325.     retVal& = SendMessage(lbhWnd%, LB_SETTABSTOPS, 3, tabs(1)) 
  2326.     'Restore the handle to whoever had it. 
  2327.     R% = PutFocus(hOldWnd%) 
  2328.     'Place some elements into the list box. 
  2329.     list1.AddItem "Name" + Chr$(9) + "Rank" + Chr$(9) + "Serial#" 
  2330.     list1.AddItem "J. Doe" + Chr$(9) + "O-3" + Chr$(9) + "1234" 
  2331.     list1.AddItem "J. Blow" + Chr$(9) + "E-1" + Chr$(9) + "5678" 
  2332.     list1.AddItem "F. Smith" + Chr$(9) + "O-6" + Chr$(9) + "0192" 
  2333.  End Sub 
  2334.  
  2335. Knowledge Base
  2336.  
  2337. Title: PR QBasic Interpreter Included with Each Copy of MS-DOS 5 
  2338. Document Number: Q73245           Publ Date: 20-JUN-1991 
  2339. Product Name: Microsoft News Releases 
  2340. Product Version: 
  2341. Operating System: 
  2342.  
  2343.  Modern Structured Programming Language, 
  2344.  QBasic Interpreter Included with Each Copy of MS-DOS 5 
  2345.  NEW YORK CITY -- June 11, 1991 -- Microsoft Corporation today 
  2346.  announced that Microsoft(R) MS-DOS(R) QBasic(TM) Interpreter, a 
  2347.  powerful, modern Basic interpreter, replaces GW-BASIC(R) interpreter 
  2348.  in the MS-DOS 5 operating system. The new MS-DOS QBasic Interpreter, 
  2349.  an interpreter-only subset of the award-winning Microsoft 
  2350.  QuickBasic(TM) compiler version 4.5, loads and runs most GW-BASIC 
  2351.  programs without modification while permitting far more powerful and 
  2352.  structured applications to be created. QBasic Interpreter is 
  2353.  completely upward-compatible with Microsoft QuickBasic compiler 
  2354.  version 4.5. 
  2355.  Basic, the world's most popular programming language, has been 
  2356.  included in the MS-DOS operating system since it first began shipping 
  2357.  in 1981. In MS-DOS 5, QBasic Interpreter replaces the 10-year-old GW- 
  2358.  BASIC interpreter. 
  2359.  "While our retail Basic products have grown and matured over the last 
  2360.  10 years, we've been looking for an opportunity to provide the same 
  2361.  modern syntax in the version that ships with MS-DOS, that we have in 
  2362.  our retail tools," said Mike Maples, vice president of applications at 
  2363.  Microsoft. "GW-BASIC and BASICA have been the first look at 
  2364.  programming for many computer users. We're excited that beginning 
  2365.  programmers, students and others interested in doing some casual 
  2366.  programming will now have a fully structured, modern programming 
  2367.  language to use -- MS-DOS QBasic Interpreter." 
  2368.  "More than 6 million PC users in the U.S. alone have used Basic in the 
  2369.  past year," said Charles Stevens, general manager of the Microsoft 
  2370.  data access business unit. "Our research shows that more people, both 
  2371.  professional programmers and average computer users, know Basic than 
  2372.  any other programming language. Microsoft now offers a complete line 
  2373.  of compatible Basic development tools for DOS*, from MS-DOS QBasic 
  2374.  Interpreter to Microsoft QuickBasic compiler to Microsoft Basic 
  2375.  professional development system. These are specifically tailored to 
  2376.  different customer segments, from the casual programmer and student to 
  2377.  the professional developer." 
  2378.  A Powerful Programming Tool 
  2379.  --------------------------- 
  2380.  MS-DOS QBasic Interpreter, like other Microsoft Basic products, uses 
  2381.  the modern Basic language. Old commands and features such as GOTO, 
  2382.  GOSUB and line numbers are unnecessary (but are supported for backward 
  2383.  compatibility). MS-DOS QBasic Interpreter also supports true 
  2384.  procedures and functions with local variables, full parameter passing, 
  2385.  modern control-flow structures (including SELECT CASE, DO/WHILE 
  2386.  LOOP/UNTIL) nested block IFs, user-defined data types structures, 
  2387.  recursion, random, binary and sequential file I/O, and global error 
  2388.  handling. 
  2389.  To make learning the language easier, detailed online help is included 
  2390.  along with code examples that can be copied into a user's program. A 
  2391.  standard, easy-to-use interface using menus and dialog boxes supports 
  2392.  both the mouse and the keyboard and functions much like the user 
  2393.  interface in Microsoft Word version 5.5 or Microsoft Works. Other 
  2394.  features include break points to speed debugging and Search & Replace 
  2395.  for making large-scale changes. 
  2396.  Because Basic is an international favorite, the MS-DOS QBasic 
  2397.  Interpreter will be localized into several languages worldwide, 
  2398.  including Russian, French, German, Italian, Swedish, Dutch, Finnish, 
  2399.  Portuguese and Korean. 
  2400.  Product support is available from Microsoft OnCall(TM) for Basic** at 
  2401.  (900) 896-9999. 
  2402.  Programs written in QBasic language typically run six times faster 
  2403.  than those written in GW-BASIC or BASICA, and have more than twice the 
  2404.  capacity, 160 K versus 64 K. (Microsoft QuickBasic compiler and Basic 
  2405.  professional development system offer increased performance over MS- 
  2406.  DOS QBasic Interpreter with capacities of 640 K and 16 MB, 
  2407.  respectively.) 
  2408.  Available Books 
  2409.  --------------- 
  2410.  More than a half-dozen books on MS-DOS QBasic Interpreter are 
  2411.  currently available or will be soon. Available now are Running QBasic 
  2412.  from Microsoft Press and QBasic Made Easy from Osborne/McGraw-Hill. 
  2413.  Scheduled for a July release are Using QBasic from Que Corporation, 
  2414.  Power QBasic and Teach Yourself QBasic from MIS Books. Howard W. Sams 
  2415.  & Company's First Book of QBasic and The Waite Group's QBasic Primer 
  2416.  Plus will be available in the fall. 
  2417.  Basic Products Available Today 
  2418.  ------------------------------ 
  2419.  In addition to the new MS-DOS QBasic Interpreter, Microsoft offers 
  2420.  several Basic products to meet the needs of different users: 
  2421.  o Microsoft Visual Basic(TM) programming system for the Microsoft 
  2422.  Windows(TM) graphical environment: announced on May 20 and now 
  2423.  shipping in quantities. Visual Basic system is the fast and easy way 
  2424.  to write applications for the Microsoft Windows graphical environment 
  2425.  version 3.0. It combines visual design tools with a powerful, event- 
  2426.  driven programming language and Windows executable program compiler to 
  2427.  enable any programmer to write full-featured Windows applications 
  2428.  quickly. 
  2429.  o Microsoft QuickBasic compiler version 4.5: the world's most popular 
  2430.  DOS-based Basic compiler/interpreter package is a superset of 
  2431.  MS-DOS QBasic Interpreter and adds the power to develop and compile 
  2432.  stand-alone executable programs that can be distributed freely. These 
  2433.  compiled .EXEs execute significantly faster than interpreted programs 
  2434.  and can access all the memory available under 640 K. Microsoft 
  2435.  QuickBasic compiler version 4.5 also has several additional debugging 
  2436.  tools such as a full range of watch variable features, multiple 
  2437.  modules and mixed-language programming support. Single-user and 10- 
  2438.  pack versions are available at a discount to students and schools for 
  2439.  teaching modern, structured programming. 
  2440.  o Microsoft Basic professional development system version 7.1: This 
  2441.  system is designed to offer the commercial application developer the 
  2442.  most powerful toolset available for creating finished DOS software 
  2443.  products fast. Basic version 7.1 includes the most powerful optimizing 
  2444.  Basic compiler available and generates the smallest and fastest 
  2445.  compiled .EXEs possible. It includes advanced memory management 
  2446.  features which make it possible to develop and compile Basic programs 
  2447.  as large as 16 MB using overlays, expanded memory, and far strings. It 
  2448.  also includes integrated data access in the form of Microsoft 
  2449.  Professional ISAM (indexed sequential access method) for data- 
  2450.  intensive business applications, the user interface toolbox for 
  2451.  creating professional user interfaces, and numerous other professional 
  2452.  language features and tools. 
  2453.  Microsoft Corporation (NASDAQ "MSFT") develops, markets and supports a 
  2454.  wide range of software for business and professional use, including 
  2455.  operating systems, network products, languages and applications as 
  2456.  well as books, hardware and CD-ROM products for the microcomputer 
  2457.  marketplace. 
  2458.  *"DOS" as used herein refers to the MS-DOS and PC-DOS operating 
  2459.  environments. 
  2460.  **$2.00 per call. 
  2461.  ### 
  2462.  Microsoft, the Microsoft logo, GW-BASIC and MS-DOS are registered 
  2463.  trademarks and Microsoft QuickBasic, OnCall, QBasic, Visual Basic and 
  2464.  Windows are trademarks of Microsoft Corporation. 
  2465.  For pricing and availability outside the U.S., please contact your 
  2466.  local subsidiary. 
  2467.  
  2468. Knowledge Base
  2469.  
  2470. Title: Huge Array Support in DLL for Visual Basic for Windows 
  2471. Document Number: Q72585           Publ Date: 24-JUN-1991 
  2472. Product Name: Microsoft Visual Basic 
  2473. Product Version:  1.00 
  2474. Operating System: WINDOWS 
  2475.  
  2476.  Summary: 
  2477.  A dynamic-link library (DLL) is available that contains functions for 
  2478.  managing arrays larger than 64K from Microsoft Visual Basic version 
  2479.  1.0 for Windows. This DLL also provides the ability to create arrays 
  2480.  with more than 32,767 (32K) elements per dimension, and to redimension 
  2481.  arrays while preserving the data inside of the arrays. 
  2482.  This file can be found in the Software/Data Library by searching for 
  2483.  the filename BV0442, the Q number of this article, or S13082. BV0442 
  2484.  was archived using the PKware file-compression utility. When you 
  2485.  decompress BV0442, you will obtain the following files: 
  2486.     HUGEARR.DLL, HUGEARR.BAS, HUGEARR.C, HUGEARR.DEF, HUGEARR.H, 
  2487.     HUGEARR.TXT, MAKEFILE 
  2488.  These files are also available on disk in the application note "Huge 
  2489.  Array Support in DLL for Visual Basic for Windows" (BV0442) by calling 
  2490.  Microsoft Product Support Services. 
  2491.  This information applies to Microsoft Visual Basic programming system 
  2492.  version 1.0 for Microsoft Windows, and to Microsoft Windows 3.0 
  2493.  Software Development Kit (SDK). HUGEARR.DLL is provided only as an 
  2494.  example, which you are free to modify, and Microsoft makes no 
  2495.  performance or support claims for HUGEARR.DLL or its associated files. 
  2496.  More Information: 
  2497.  To use the functions in HUGEARR.DLL, copy the declarations contained 
  2498.  in HUGEARR.BAS into your global module in Visual Basic and copy 
  2499.  HUGEARR.DLL to your Windows directory. The functions can then be used 
  2500.  like any other Windows DLL function. 
  2501.  HUGEARR.DLL allocates memory using the Windows API function 
  2502.  GlobalAlloc. This means that the largest array that can be allocated 
  2503.  is 1 MB in standard mode, and 64 MB in 386 enhanced mode for Windows. 
  2504.  The following routines are contained in HUGEARR.DLL. For a complete 
  2505.  description of the parameters and/or return values of these routines, 
  2506.  see Visual Basic's Declare statement for the routine in question in 
  2507.  the file HUGEARR.BAS. For additional notes on using these functions, 
  2508.  see the HUGEARR.TXT reference file. 
  2509.  1. HugeDim: 
  2510.     Dimensions an array and returns a handle to that array. 
  2511.  2. HugeErase: 
  2512.     Erases an array that was previously dimensioned using HugeDim. 
  2513.  3. HugeRedim: 
  2514.     Redimensions an array created with HugeDim to a different size. 
  2515.  4. GetHugeEl, SetHugeEl: 
  2516.     Gets or sets the contents of the specified array element in a given 
  2517.     huge array. 
  2518.  5. HugeInt, HugeLong, HugeSingle, HugeDouble, HugeCurrency: 
  2519.     Functions that return a value from a specific element in a huge 
  2520.     array of the type corresponding to the function name (Integer, 
  2521.     Long, Single, Double, or Currency data type.) 
  2522.  6. HugeUbound: 
  2523.     Returns the upper bound of a given huge array. 
  2524.  7. NumHugeArrays: 
  2525.     Returns the number of free huge array handles available. 
  2526.  
  2527.  References:
  2528.  HUGEARR.DLL is written in Microsoft C, and the C source code is 
  2529.  provided in HUGEARR.C and HUGEARR.H. Advanced programmers can 
  2530.  optionally modify and rebuild HUGEARR.DLL by using the Microsoft C 
  2531.  Compiler version 6.0 or 6.0a and DLL libraries from the Microsoft 
  2532.  Windows 3.0 Software Development Kit (SDK), and by running NMAKE.EXE 
  2533.  with the enclosed MAKEFILE. The MAKEFILE tells LINK.EXE to use the 
  2534.  enclosed linker definition file, HUGEARR.DEF. 
  2535.  
  2536. Knowledge Base
  2537.  
  2538. Title: Wrong Default Path After Drive Error, VB Open/Add File Dialog 
  2539. Document Number: Q72878           Publ Date: 25-JUN-1991 
  2540. Product Name: Microsoft Visual Basic 
  2541. Product Version:  1.00 
  2542. Operating System: WINDOWS 
  2543.  
  2544.  Summary: 
  2545.  When you choose the Open Project or Add File option from the File menu 
  2546.  in the VB.EXE environment, and you get an error accessing a disk 
  2547.  drive, Visual Basic incorrectly stays logged onto the failed drive 
  2548.  path (even though the previous path is displayed), unless you 
  2549.  explicitly change the drive. (This behavior differs from the Open 
  2550.  command from the File menu in standard Windows applications, such as 
  2551.  Microsoft Word for Windows and Microsoft Excel for Windows.) 
  2552.  Microsoft has confirmed this to be a problem in Microsoft Visual Basic 
  2553.  programming system version 1.0 for Windows. Microsoft is researching 
  2554.  this problem and will post new information here as it becomes 
  2555.  available. 
  2556.  To work around this problem, just change to a valid drive by typing a 
  2557.  path preceded by a valid drive letter, or by selecting a valid drive 
  2558.  letter with the mouse. 
  2559.  More Information: 
  2560.  To duplicate this problem, follow these steps: 
  2561.  1. Start Visual Basic (such as from the C:\VB\ subdirectory for the 
  2562.     following example). 
  2563.  2. From the File menu, choose Open Project or Add File. (The Open 
  2564.     Project or Add File dialog box lets you search for and select the 
  2565.     file you want.) 
  2566.  3. Make sure drive A is empty and open. 
  2567.  4. Select [-a-| from the dialog box. A message box will correctly 
  2568.     appear with the error message "Path Not Found:'' ". (What appears 
  2569.     to be one double quotation mark is really two single quotation 
  2570.     marks with nothing between them.) 
  2571.  5. Choose the OK button. Note that the current path, such as C:\VB 
  2572.     (displayed above the Directories box), is correctly shown to be the 
  2573.     same as before drive A was selected. The Files and Directories 
  2574.     boxes also correctly show the same files as before drive A was 
  2575.     selected. (So far, this behavior is the same as for the files 
  2576.     dialog box in standard Windows applications.) 
  2577.  6. Erase the information in the File Name field, and type the 
  2578.     following: 
  2579.        *.* 
  2580.  7. Choose the OK button. 
  2581.  8. The problem is that Visual Basic now incorrectly gives you the 
  2582.     "Path Not Found:'' " error message, which demonstrates that the 
  2583.     actual current drive fails to match the displayed path (C:\VB), and 
  2584.     Visual Basic is incorrectly attempting to access drive A again. 
  2585.     This behavior differs from standard Windows applications, such as 
  2586.     Microsoft Word for Windows and Excel for Windows, which don't give 
  2587.     an error at this point, and instead correctly show all (*.*) files 
  2588.     in the path (C:\VB) displayed in the dialog box. 
  2589.     To work around this problem, just change to a valid drive by typing 
  2590.     a path preceded by a valid drive letter, such as C:\VB\*.*, or by 
  2591.     selecting a valid drive letter, such as [-c-| with the mouse. 
  2592.  
  2593. Knowledge Base
  2594.  
  2595. Title: Settings Box Is Hidden When Properties Bar at Bottom of Screen 
  2596. Document Number: Q72881           Publ Date: 25-JUN-1991 
  2597. Product Name: Microsoft Visual Basic 
  2598. Product Version:  1.00 
  2599. Operating System: WINDOWS 
  2600.  
  2601.  Summary: 
  2602.  When the Properties bar is positioned at the bottom of the screen and 
  2603.  an enumerated property, such as FontName, is selected from the 
  2604.  Settings box, the FontName list is still displayed beneath the 
  2605.  Properties bar, instead of above the Properties bar, making the 
  2606.  FontName list essentially invisible. Because of this behavior, 
  2607.  Microsoft recommends leaving the Properties bar at the top of the 
  2608.  screen. 
  2609.  Note: The Properties bar's entry field is not a combo box, and does 
  2610.  not react as a combo box. 
  2611.  This information applies to Microsoft Visual Basic programming system 
  2612.  version 1.0 for Windows. 
  2613.  More Information: 
  2614.  When you open a combo box and the space below is insufficient to 
  2615.  display the drop-down list, the list will be displayed above the combo 
  2616.  box window. This is exactly how the combo box "Properties list box" 
  2617.  displays when the Properties bar is moved to the bottom of the screen. 
  2618.  Although the Settings box resembles a combo box, the Settings box is 
  2619.  actually an edit box and a push button. This window is not a combo box 
  2620.  because the push button can take on several functions. In some cases 
  2621.  the Settings box is disabled, and in some cases it invokes a pop-up 
  2622.  dialog box (for example, when you select the Picture property of the 
  2623.  Picture control). In other cases, such as for the FontName property, 
  2624.  the Settings box displays a Windows list box just under the Properties 
  2625.  bar. The location of the list box is determined by Visual Basic and 
  2626.  will always be displayed below the Properties bar. 
  2627.  Microsoft recommends leaving the Properties bar at the top of the 
  2628.  screen. 
  2629.  Reference: 
  2630.  Please refer to pages 38-39 of the "Microsoft Visual Basic: 
  2631.  Programmer's Guide" for version 1.0 for definitions of Properties bar, 
  2632.  Properties list box, and Settings box. 
  2633.  
  2634. Knowledge Base
  2635.  
  2636. Title: Why VB Sub Might Stay in Proc: List Even After Code Deleted 
  2637. Document Number: Q73270           Publ Date: 25-JUN-1991 
  2638. Product Name: Microsoft Visual Basic 
  2639. Product Version:  1.00 
  2640. Operating System: WINDOWS 
  2641.  
  2642.  Summary: 
  2643.  In a Visual Basic code window, if you want to delete the code for a 
  2644.  Sub...End Sub procedure (or Function...End Function procedure), you 
  2645.  must also delete the two or more blank lines (if any) following that 
  2646.  procedure, or else that procedure will still exist (in a blank code 
  2647.  window and in the Proc: box). 
  2648.  Microsoft has confirmed this to be a problem in Microsoft Visual Basic 
  2649.  version 1.0 programming system for Windows. We are researching this 
  2650.  problem and will post new information here as it becomes available. 
  2651.  To work around this problem, make sure to delete all blank lines in 
  2652.  the code window for the procedure that you want to delete. 
  2653.  More Information: 
  2654.  Steps to Reproduce Problem 
  2655.  -------------------------- 
  2656.  1. Start Visual Basic (or select New Project from Visual Basic's File 
  2657.     menu if you are already in Visual Basic). 
  2658.  2. Double-click Form1, or press F7, to display the form's Code window. 
  2659.  3. Choose (general) from the Object: box, and enter the statement 
  2660.     Sub Sub1 in the (general) (declarations) code window, and press the 
  2661.     ENTER key. This causes Visual Basic to display the following Sub 
  2662.     procedure: 
  2663.        Sub Sub1() 
  2664.        End Sub 
  2665.  4. Press CTRL+END, or click to the blank line after the End Sub 
  2666.     statement. 
  2667.  5. Press the ENTER key to add a few blank lines after the End Sub 
  2668.     statement. 
  2669.  6. Using the mouse, select (highlight) from the Sub Sub1() statement 
  2670.     to the End Sub statement (but to duplicate the problem, don't 
  2671.     highlight the blank lines after the End Sub statement). From the 
  2672.     Edit menu, choose Delete, or press the DEL key, to delete the 
  2673.     selected text. 
  2674.  7. Now the Proc: box still indicates that Sub1 exists as a procedure, 
  2675.     even though you just tried to delete it. 
  2676.  This problem is caused by the blank lines that were added after the 
  2677.  End Sub statement. To work around the problem, highlight and delete 
  2678.  the blank lines in the Sub1 code window, and the Sub1 procedure will 
  2679.  be properly deleted. 
  2680.  Additional reference words: 1.00 
  2681.  
  2682. Knowledge Base
  2683.  
  2684. Title: Can't Get Help Within Any VB Dialog Box After an Error 
  2685. Document Number: Q73119           Publ Date: 25-JUN-1991 
  2686. Product Name: Microsoft Visual Basic 
  2687. Product Version:  1.00 
  2688. Operating System: MS-DOS 
  2689.  
  2690.  Summary: 
  2691.  If you are in any Visual Basic dialog box and an error occurs, after 
  2692.  you dismiss the error message, pressing F1 to get help for the dialog 
  2693.  box will result in getting help on the previous error message, not 
  2694.  help on the dialog box. 
  2695.  Microsoft has confirmed this problem in Microsoft Visual Basic 
  2696.  programming system version 1.0 for Windows. We are researching this 
  2697.  problem and will post new information here as it becomes available. 
  2698.  More Information: 
  2699.  The following steps reproduce the error: 
  2700.  1. From the File menu, choose Save Project. 
  2701.  2. Enter an invalid filename for saving the project. 
  2702.  3. An error message will pop up telling you that the filename is 
  2703.     incorrect. 
  2704.  4. Press ENTER or double-click the OK button to dismiss the error 
  2705.     message. 
  2706.  5. Press the F1 key to get help on the Save Project dialog box. 
  2707.  6. The help message for the error will pop up, instead of help for the 
  2708.     dialog box. 
  2709.  This behavior is incorrect. The above steps should give you help for 
  2710.  the Save Project dialog box. 
  2711.  To work around the problem and get correct help on this dialog box, 
  2712.  dismiss the incorrect error message by double-clicking the control 
  2713.  button, and click CANCEL to get rid of the Save Project dialog box. 
  2714.  Now, choose Save Project from the File menu and press F1; the correct 
  2715.  help should display. 
  2716.  To get help on the error message, press F1 while the error message is 
  2717.  displayed. 
  2718.  
  2719. Knowledge Base
  2720.  
  2721. Title: "Method Not Applicable..." with IsHidden Method in VB 
  2722. Document Number: Q73154           Publ Date: 25-JUN-1991 
  2723. Product Name: Microsoft Visual Basic 
  2724. Product Version:  1.00 
  2725. Operating System: WINDOWS 
  2726.  
  2727.  Summary: 
  2728.  "IsHidden" was a method implemented in prerelease versions of Visual 
  2729.  Basic, but IsHidden was removed in the released version (because it 
  2730.  was no longer needed). However, using IsHidden as the name for a 
  2731.  variable, Sub, Function, or object can still give the following error 
  2732.  at run time: 
  2733.     Method not applicable with this Object 
  2734.  To work around this problem, avoid using the name IsHidden. 
  2735.  This information applies to Microsoft Visual Basic programming system 
  2736.  version 1.0 for Windows. 
  2737.  More Information: 
  2738.  The following example demonstrates the problem: 
  2739.  1. Within any event procedure, try the following: 
  2740.        Sub Form_Click() 
  2741.           print ishidden 
  2742.        End Sub 
  2743.  2. This gives a syntax error asking you to add a "(" to the method, 
  2744.     so continue by adding "()": 
  2745.        Sub Form_Click() 
  2746.           print ishidden() 
  2747.        End Sub 
  2748.  3. This results in the following format after pressing ENTER after 
  2749.     ishidden(): 
  2750.        Sub Form_Click() 
  2751.           Print IsHidden() 
  2752.        Sub End 
  2753.     This is the format for a predefined method called IsHidden(). 
  2754.  After following the steps above, you will receive a run-time error 
  2755.  "Method not applicable with this Object." This error results because 
  2756.  this particular method was not completely unimplemented from the beta 
  2757.  version. 
  2758.  Microsoft will consider completely removing this behavior of the 
  2759.  IsHidden name in a future version of Visual Basic. 
  2760.  
  2761. Knowledge Base
  2762.  
  2763. Title: Make EXE with 40-Byte Title Displays Only 39 in Task List 
  2764. Document Number: Q73155           Publ Date: 25-JUN-1991 
  2765. Product Name: Microsoft Visual Basic 
  2766. Product Version:  1.00 
  2767. Operating System: WINDOWS 
  2768.  
  2769.  Summary: 
  2770.  This information applies to Microsoft Visual Basic programming system 
  2771.  version 1.0 for Windows. 
  2772.  The following steps demonstrate a problem with Microsoft Windows 3.0; 
  2773.  the problem is not caused by Microsoft Visual Basic version 1.0: 
  2774.  1. Start Visual Basic. 
  2775.  2. From Visual Basic's File Menu, choose the Make EXE File command. 
  2776.  3. A Make EXE File dialog box will display. Enter a 40-character 
  2777.     filename in the File Name box. 
  2778.  4. Double-click the OK command button to exit the dialog box. 
  2779.  5. Minimize Visual Basic, go to the Windows Program Manager menu, and 
  2780.     choose File. 
  2781.  6. From the File menu, choose the Run option; the Run dialog box will 
  2782.     display. 
  2783.  7. Now enter that 40-character .EXE filename or path to the .EXE 
  2784.     filename in the Command Line box, and double-click OK when done. 
  2785.  8. The .EXE file will run correctly, but if you press CTRL+ESC to 
  2786.     bring up the Task List box, you will see that your .EXE filename 
  2787.     has been truncated to 39 characters (it no longer is 40 
  2788.     characters). 
  2789.  Microsoft has confirmed this problem in the Microsoft Windows version 
  2790.  3.0 operating system (buglist3.00). We are researching this problem 
  2791.  and will post new information here as it becomes available. 
  2792.  Additional reference words: 3.00 
  2793.  
  2794. Knowledge Base
  2795.  
  2796. Title: Removing Disk During VB Setup Terminates SETUP, Missing Files 
  2797. Document Number: Q73157           Publ Date: 25-JUN-1991 
  2798. Product Name: Microsoft Visual Basic 
  2799. Product Version:  1.00 
  2800. Operating System: WINDOWS 
  2801.  
  2802.  Summary: 
  2803.  While running SETUP.EXE for Visual Basic, you may fail to copy all 
  2804.  files (or experience other problems) if you try to remove the disk 
  2805.  while the SETUP.EXE program is in progress. 
  2806.  Microsoft has confirmed this problem in Microsoft Visual Basic 
  2807.  programming system version 1.0 for Windows. We are researching this 
  2808.  problem and will post new information here as it becomes available. 
  2809.  To work around this problem, wait until SETUP indicates that 100 
  2810.  percent of the files are copied before removing the Visual Basic 
  2811.  floppy disk. 
  2812.  More Information: 
  2813.  Below is an example of one specific problem: 
  2814.  When running SETUP.EXE on Disk 1 of Visual Basic (using 1.2 MB 5.25- 
  2815.  inch disks), you can choose the option to install Visual Basic only. 
  2816.  SETUP's bar graph will start by displaying 4 percent done, and while 
  2817.  the large file C:\VB\VB.EXE is being copied, the disk drive light may 
  2818.  go off and you might assume that Visual Basic is finished running 
  2819.  SETUP. At this point you might (mistakenly) remove Disk 1. Then a 
  2820.  message tells you that SETUP is complete, and you can exit SETUP. 
  2821.  You have now installed VB.EXE, but you did not install some of the 
  2822.  other important files, such as VBRUN100.DLL, which is needed to run 
  2823.  your compiled applications under Windows version 3.0. 
  2824.  If you want to install Visual Basic by selecting Visual Basic only, 
  2825.  then you need to let Disk 1 complete its processing by waiting until 
  2826.  the bar displays 100 percent. If you let Disk 1 run to completion, 
  2827.  then the installed directory C:\VB should correctly contain the 
  2828.  following files: 
  2829.     VB.EXE 
  2830.     VB.HLP 
  2831.     VBRUN100.DLL 
  2832.     README.TXT 
  2833.     PACKING.LST 
  2834.     SETUP.EXE 
  2835.     DECOMP.DLL 
  2836.     CONSTANT.TXT 
  2837.  Additional reference words: 1.00 3.00 
  2838.